Back to index

plt-scheme  4.2.1
nan.h
Go to the documentation of this file.
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 64 bit machines or other machines with GCC
00013  *
00014  * Revisions:      None
00015  *
00016  *****************************************************************************/
00017 
00018 #if !defined(_NAN_H)
00019 #define _NAN_H
00020 
00021 #if defined(__GNUC__)
00022 static const double NaN = 0.0 / 0.0;
00023 #elif defined(BIG_ENDIAN)
00024 static const long long lNaN = 0x7fffffffffffffff;
00025 
00026 #define NaN (*(double*)&lNaN)
00027 #else
00028 static const long  lNaN = 0xfff8000000000000;
00029 
00030 #define NaN (*(double*)&lNaN)
00031 #endif
00032 
00033 #endif