[PATCH] Fix truncf for sNaN input
Keith Packard
keithp@keithp.com
Wed Mar 11 22:41:16 GMT 2020
Joseph Myers <joseph@codesourcery.com> writes:
> That manpage is wrong. The underlying IEEE operation should raise
> "invalid" and return a qNaN for an sNaN operand (but never raises
> "inexact").
Hrm. IEEE 754 says that you only get "invalid" if the NaN or infinite
operand cannot be represented in the destination format. As these
functions return the same type as their operand, NaN and inf values can
be represented in the return value.
Are you referring to some other standard?
Also, glibc works the way the manual says, and I'd really like newlib
and glibc to have the same general behavior, even if newlib isn't quite
as accurate as glibc for some operations.
--
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20200311/b2cdc31b/attachment.sig>
More information about the Newlib
mailing list