Subject: First word of infinity...
To: None <tech-pkg@netbsd.org>
From: Johnny C. Lam <lamj@stat.cmu.edu>
List: tech-pkg
Date: 05/18/2000 23:25:56
I'm looking at the latest version of the SGI STL, and in the limits
file is a template instantiation that looks like:

__STL_TEMPLATE_NULL class numeric_limits<float>
  : public _Floating_limits<float,
                            FLT_MANT_DIG,   // Binary digits of precision
                            FLT_DIG,        // Decimal digits of precision
                            FLT_MIN_EXP,    // Minimum exponent
                            FLT_MAX_EXP,    // Maximum exponent
                            FLT_MIN_10_EXP, // Minimum base 10 exponent
                            FLT_MAX_10_EXP, // Maximum base 10 exponent
                            0x7f800000u,    // First word of +infinity
                            0x7f810000u,    // First word of quiet NaN
                            0x7fc10000u,    // First word of signaling NaN
                            true,           // conforms to iec559
                            round_to_nearest>

Notice the _constants_ for the first words of +infinity, quiet NaN,
and signaling NaN.  Is there a portable way to get these constants
on each platform?  For each of float, double, and long double?

BTW, I have no idea what quiet/signaling NaN are, but I'd like to make
a pkgsrc entry out of this for C++ programmers needing a better STL
than the pitiful one in our NetBSD tree, and this is the only file
with platform-dependent bits.

Thanks in advance,

     -- Johnny C. Lam <lamj@stat.cmu.edu>
        Department of Statistics, Carnegie Mellon University
        http://www.stat.cmu.edu/~lamj/