This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] math: Merge strtod_nam_*.h into math-type-macros-*.h
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Tue, 15 May 2018 15:04:27 +0000
- Subject: Re: [PATCH] math: Merge strtod_nam_*.h into math-type-macros-*.h
- References: <20180513203019.C0C2A4016D681@oldenburg.str.redhat.com>
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