[Cfp-interest 2713] Re: log(1)
Vincent Lefevre
vincent at vinc17.net
Tue Feb 28 00:38:34 PST 2023
On 2023-02-28 07:08:18 +0200, Fred J. Tydeman wrote:
> Annex F.10.3.11 has log(1) returns +0
This was already the case in C99 (F.9.3.7), thus before the
specification in IEEE 754. Then the same specification was
chosen for IEEE 754-2008:
For the operations log, log2, and log10, f(±0) is −∞ and
signals the divideByZero exception, and f(1) is +0.
So...
> Now, what if rounding mode is round to -infinity, should the return
> value be -0?
No, this is forbidden.
> I have encountered a math library that does that.
This is a bug.
--
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
More information about the Cfp-interest
mailing list