This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] math: Merge strtod_nam_*.h into math-type-macros-*.h


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]