[cfp-interest 3625] Consistency in paragraphs using NaNs

Damian McGuckin damianm at esi.com.au
Tue Sep 23 19:23:24 PDT 2025


In F.2.2#4, F.2.2#6, and F10.1#14, there is the following text:

Any operator or <math.h> function that raises an "invalid" floating-point
exception, if delivering a floating type result, shall return a quiet NaN,
unless explicitly specified otherwise.

Any floating-point operator or <math.h> function or macro with a signaling
NaN input, unless explicitly specified otherwise, raises an "invalid"
floating-point exception.

Functions with a NaN argument return a NaN result and raise no
floating-point exception unless explicitly stated otherwise.

In the quest for consistency, the core question is ....

Is it excessively consistent or does it change the meaning if we ask that 
these three should all comply with the following sentence structure:

 	Any floating-point operator or <math.h> function or macro
 	... CONTENT ...
 	unless explicitly stated otherwise.

where CONTENT is respectively

 	that delivers a floating-point result and
 	raises an "invalid" floating-point exception
 	shall return a quiet NaN

 	with a signaling NaN argument
 	raises an "invalid" floating-point exception

 	with a quiet NaN argument
 	that delivers a floating-point result,
 	returns a quiet NaN result and
 	raises no floating-point exception

In the last case, F.2.2 allows the use of just the bare term NaN to mean a 
quiet NaN but I was trying to be extremely clear (and it costs only two 
more words). There is no "shall" in the last case.

Do we need to bring in <tgmath.h>?

Thanks - Damian


More information about the cfp-interest mailing list