[PATCH v2] Replace copysign (0,-1) with -0.0 in initializer
Joseph Myers
josmyers@redhat.com
Tue Dec 17 00:11:13 GMT 2024
On Tue, 17 Dec 2024, Maciej W. Rozycki wrote:
> I was not able to track down a definitive standards reference requiring
> IEEE 754 compiler implementations to respect the sign of zero in literals,
> would you or anyone else be able to point me at one?
C23 Annex F binds unary '-' to the 'negate' operation (which is defined in
IEEE 754 as a quiet-computational operation that affects only the sign
bit, even for NaNs), and specifies that literal conversions (bound to
convertFromDecimalCharacter, though the detailed syntax is given in the C
standard) are correctly rounded up to at least CR_DECIMAL_DIG digits.
--
Joseph S. Myers
josmyers@redhat.com
More information about the Libc-alpha
mailing list