Re: BUG #16281: LN() function inaccurate at 1000th fractional digit - Mailing list pgsql-bugs

From Dean Rasheed
Subject Re: BUG #16281: LN() function inaccurate at 1000th fractional digit
Date
Msg-id CAEZATCVi=KpqHid+DBkn27Es9+SOkFyo2_wSX892aUP_8P6_-w@mail.gmail.com
Whole thread Raw
In response to BUG #16281: LN() function inaccurate at 1000th fractional digit  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #16281: LN() function inaccurate at 1000th fractional digit
List pgsql-bugs
On Fri, 28 Feb 2020 at 05:43, PG Bug reporting form
<noreply@postgresql.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



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #16281: LN() function inaccurate at 1000th fractional digit
Next
From: PG Bug reporting form
Date:
Subject: BUG #16282: Avoid sql-injections at identifiers