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