Re: BUG #16281: LN() function inaccurate at 1000th fractional digit

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: anyhowstep(at)hotmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #16281: LN() function inaccurate at 1000th fractional digit
Date: 2020-02-28 07:18:55
Message-ID: CAEZATCVi=KpqHid+DBkn27Es9+SOkFyo2_wSX892aUP_8P6_-w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, 28 Feb 2020 at 05:43, PG Bug reporting form
<noreply(at)postgresql(dot)org> wrote:
>
> Given this, ...
>
> The last digit should be a 2, but pg thinks it's a 3,
>

Yeah, that's not at all surprising. All the transcendental numeric
functions are basically +/-1 in the final digit. Guaranteeing the
correct answer in the final digit is a hard problem, that involves
tracking errors accurately as the computation proceeds, and then
possible re-doing the whole thing if the final digit of the result is
on that rounding boundary that makes it impossible to determine which
way to round without using a higher internal precision.

I don't think anyone has the appetite to put in the effort to do that,
and even if they did, the patch might still be rejected if it hurt
performance too much -- it seems inevitable that there would be some
performance hit, but I don't know how much it'd be.

Regards,
Dean

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2020-02-28 08:00:33 BUG #16282: Avoid sql-injections at identifiers
Previous Message Michael Paquier 2020-02-28 07:17:12 Re: Assert failure due to "drop schema pg_temp_3 cascade" for temporary tables and \d+ is not showing any info after drooping temp table schema