On Wed, 19 Aug 2015, Andreas Schwab wrote: > >> Why only in usafe mode? Isn't the sign bit of NaN always unreliable? > > > > NaN sign bits are meaningful for a limited set of operations. > > And what are those?
Assignment to the same type, negation, absolute value, copysign, signbit. (In particular, the sign bit of a NaN resulting from an arithmetic operation is unspecified, but it does have to act as if it has some particular sign; if the statement "a = b * c;" results in a containing a NaN, two calls to signbit (a), with a not modified in between, must result in the same sign being indicated, but what that value is doesn't matter, and signbit (-a) must result in the other sign being indicated.) -- Joseph S. Myers jos...@codesourcery.com