develooper Front page | perl.perl5.porters | Postings from February 2015

SNAN/QNAN constants

February 4, 2015 14:30
SNAN/QNAN constants
Message ID:
I noticed an obvious typo in this commit:

commit 533686c97e2bcc046e9f800c5a5501785c800c62
Author: Jarkko Hietaniemi <>
Date:   2015-02-01 12:16:59 -0500

    infnan: define NV_QNAN and NV_SNAN if feasible

 #if !defined(NV_NAN) && defined(DBL_SNAN)
 #  define NV_NAN (NV)DBL_SNAN
+#  define NV_SNAN DBL_QNAN

Surely that should be DBL_SNAN, not QNAN.

Another thing I noticed is that NV_QNAN and NV_SNAN only get set if none
of the NAN forms checked before them are defined, but they don't get set
if plain SNAN or QNAN are the chosen NAN form:

#if !defined(NV_NAN) && defined(QNAN)
#  define NV_NAN (NV)QNAN
#if !defined(NV_NAN) && defined(SNAN)
#  define NV_NAN (NV)SNAN

I don't know which platforms provide those constants, and what
combinations they exist in, but if NV_QNAN and NV_SNAN are to be useful
at all, they should be defined whenever the platform provides explicit
quiet and signalling NaNs, regardless of which one NV_NAN ends up being.

"A disappointingly low fraction of the human race is,
 at any given time, on fire." - Stig Sandbeck Mathisen Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About