[PATCH] math: Merge strtod_nam_*.h into math-type-macros-*.h
Joseph Myers
joseph@codesourcery.com
Tue May 15 15:04:00 GMT 2018
On Sun, 13 May 2018, Florian Weimer wrote:
> + SET_MANTISSA(flt, mant)
> + Set the variable FLT of type FLOAT to the mantissa MANT. */
It's specifically setting the *NaN payload* to MANT, not the value of the
variable. SET_MANTISSA is using the ieee_nan union member, which
separates the NaN payload bits from the quiet NaN bit.
Given that it's specific to NaNs, and would do the wrong thing if you
expected to be able to set the whole mantissa of other floating-point
values, I don't think this should be called SET_MANTISSA in a
non-NaN-specific header. What that indicates to me is renaming the macro
to e.g. SET_NAN_MANTISSA or SET_NAN_PAYLOAD, and calling the
math-mantissa-*.h headers something with "nan" in their name to reflect
that they are specific to NaNs.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list