[cfp-interest 3779] Annex F 2.2#7 - Signaling NaNs as an argument

Damian McGuckin damianm at esi.com.au
Tue Feb 3 16:27:34 PST 2026


Recommended Practice says

 	NOTE Some functions do not propagate quiet NaN arguments. For
 	example, hypot(x, y) returns infinity if x or y is infinite and
 	the other is a quiet NaN. The recommended practice in this
 	subclause specifies that such functions (and others) raise the
 	"invalid" floating-point exception if an argument is a signaling
 	NaN, which also implies they return a quiet NaN in these cases.

This clause talks about propogating quiet NaN arguments. And yet midway 
through, it talks about signaling NaNs.

Am I right that this is the only place that says a function given a 
signaling NaN argument shall return a quiet NaN. If so, this is a bit 
obtuse.  Do we need to clarify those words a bit better.

In F.10.4.19, i.e., scalbn, it says

 	scalbn(x, 0) returns x

Some people might think that means that given a signaling NaN argument x, 
it should return the signaling NaN. Do we need to make that definition 
tighter, e.g.

 	scalbn(x, 0) returns x for all x (including NaN)

Thanks - Damian


More information about the cfp-interest mailing list