PLplot
5.10.0
|
00001 //-------------------------------------------------------------------------- 00002 // 00003 // File: nan.h 00004 // 00005 // Created: 18/10/2001 00006 // 00007 // Author: Pavel Sakov 00008 // CSIRO Marine Research 00009 // 00010 // Purpose: NaN definition 00011 // 00012 // Description: Should cover machines with 64 bit doubles or other machines 00013 // with GCC 00014 // 00015 // Revisions: None 00016 // 00017 //-------------------------------------------------------------------------- 00018 00019 #if !defined ( _NAN_H ) 00020 #define _NAN_H 00021 00022 #if ( defined ( __GNUC__ ) && !defined ( __ICC ) ) || defined ( __BORLANDC__ ) 00023 00024 static const double NaN = 0.0 / 0.0; 00025 00026 #ifdef __BORLANDC__ 00027 #define isnan _isnan 00028 #define copysign _copysign 00029 #endif 00030 00031 #elif defined ( WIN32 ) 00032 00033 #if !defined ( _MSC_VER ) 00034 00035 static unsigned _int64 lNaN = ( (unsigned _int64) 1 << 63 ) - 1; 00036 00037 #define NaN ( *(double *) &lNaN ) 00038 00039 #else 00040 00041 // MSVC/C++ 6.0 reports a version 1200, 00042 // MSVC/C++ 2003 reports a version 1300 00043 // 00044 #include <float.h> 00045 #include <ymath.h> 00046 #undef NaN 00047 #if _MSC_VER < 1300 00048 #define NaN _Nan._D 00049 #else 00050 #define NaN _Nan._Double 00051 #endif 00052 00053 #define isnan _isnan 00054 #define copysign _copysign 00055 00056 #endif 00057 00058 #else 00059 00060 static const long long lNaN = ( (unsigned long long) 1 << 63 ) - 1; 00061 00062 #define NaN ( *(double *) &lNaN ) 00063 00064 #endif 00065 00066 #endif