home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!taumet!steve
- From: steve@taumet.com (Steve Clamage)
- Subject: Re: NaN - magic value
- Message-ID: <1992Jul29.172252.5463@taumet.com>
- Organization: TauMetric Corporation
- References: <1992Jul29.084722.6906@cv.ruu.nl>
- Date: Wed, 29 Jul 1992 17:22:52 GMT
- Lines: 21
-
- ger@cv.ruu.nl (Ger Timmens) writes:
-
-
- >I want to assign a magic value to certain double variables;
- >Currently I return DBL_MAX, as defined in <float.h>.
-
- >Is it possible to assign the value NaN, to double variables ?
- >(NaN = NotANumber, e.g. dDouble = 1.0 / 0.0 ==> dDouble == NaN)
-
- It depends entirely on the implementation of floating-point on your
- system. Implementations are not required to supply NaN as a value
- or result, and if they do, they are allowed to generate a signal
- which you would have to catch.
-
- Check the documentation for your system to see whether it uses NaN's,
- and how to use them. I suggest you isolate any code using NaN to
- one module, since the code will not be portable.
- --
-
- Steve Clamage, TauMetric Corp, steve@taumet.com
- Vice Chair, ANSI C++ Committee, X3J16
-