~uhh-ssd/+junk/humidity_readout

1 by Joachim Erfle
initial commit
1
//--------------------------------------------------------------------------
2
//
3
// File:           nan.h
4
//
5
// Created:        18/10/2001
6
//
7
// Author:         Pavel Sakov
8
//                 CSIRO Marine Research
9
//
10
// Purpose:        NaN definition
11
//
12
// Description:    Should cover machines with 64 bit doubles or other machines
13
//                 with GCC
14
//
15
// Revisions:      None
16
//
17
//--------------------------------------------------------------------------
18
19
#if !defined ( _NAN_H )
20
#define _NAN_H
21
22
#if ( defined ( __GNUC__ ) && !defined ( __ICC ) ) || defined ( __BORLANDC__ )
23
24
static const double NaN = 0.0 / 0.0;
25
26
#ifdef __BORLANDC__
27
  #define isnan       _isnan
28
  #define copysign    _copysign
29
#endif
30
31
#elif defined ( WIN32 )
32
33
#if !defined ( _MSC_VER )
34
35
static unsigned _int64 lNaN = ( (unsigned _int64) 1 << 63 ) - 1;
36
37
#define NaN    ( *(double *) &lNaN )
38
39
#else
40
41
// MSVC/C++ 6.0 reports a version 1200,
42
// MSVC/C++ 2003 reports a version 1300
43
//
44
#include <float.h>
45
#include <ymath.h>
46
#undef NaN
47
#if _MSC_VER < 1300
48
#define NaN         _Nan._D
49
#else
50
#define NaN         _Nan._Double
51
#endif
52
53
#define isnan       _isnan
54
#define copysign    _copysign
55
56
#endif
57
58
#else
59
60
static const long long lNaN = ( (unsigned long long) 1 << 63 ) - 1;
61
62
#define NaN    ( *(double *) &lNaN )
63
64
#endif
65
66
#endif
67
68
69
//#if !defined(_NAN_H)
70
// #define _NAN_H
71
//
72
// #if defined(__GNUC__)
73
// static const double NaN = 0.0 / 0.0;
74
// #elif defined(BIG_ENDIAN) || defined(_BIG_ENDIAN)
75
// static const long long lNaN = 0x7fffffffffffffff;
76
//
77
// #define NaN (*(double*)&lNaN)
78
// #else
79
// static const long long lNaN = 0xfff8000000000000;
80
//
81
// #define NaN (*(double*)&lNaN)
82
// #endif
83
//
84
// #endif