Menu

[r4153]: / branches / transforms / src / MPL_isnan.h  Maximize  Restore  History

Download this file

64 lines (54 with data), 1.7 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
These definitions were inspired by and originally modified from
numarray's Include/numarray/nummacro.h
The "64" below refers to double precision floating point numbers. This
code only works on doubles.
*/
#if defined(SIZEOF_VOID_P)
#if SIZEOF_VOID_P == 8
#define MPL_LP64 1
#else
#define MPL_LP64 0
#endif
#else
#define MPL_LP64 0
#endif
#if MPL_LP64
typedef long int MPL_Int64;
#else /* 32-bit platforms */
#if defined(_MSC_VER)
typedef __int64 MPL_Int64;
#else
typedef long long MPL_Int64;
#endif
#endif
#if !defined(MPL_U64)
#define MPL_U64(u) (* (MPL_Int64 *) &(u) )
#endif /* MPL_U64 */
#if !defined(MPL_isnan64)
#if !defined(_MSC_VER)
#define MPL_isnan64(u) \
( (( MPL_U64(u) & 0x7ff0000000000000LL) == 0x7ff0000000000000LL) && ((MPL_U64(u) & 0x000fffffffffffffLL) != 0)) ? 1:0
#else
#define MPL_isnan64(u) \
( (( MPL_U64(u) & 0x7ff0000000000000i64) == 0x7ff0000000000000i64) && ((MPL_U64(u) & 0x000fffffffffffffi64) != 0)) ? 1:0
#endif
#endif /* MPL_isnan64 */
#if !defined(MPL_isinf64)
#if !defined(_MSC_VER)
#define MPL_isinf64(u) \
( (( MPL_U64(u) & 0x7ff0000000000000LL) == 0x7ff0000000000000LL) && ((MPL_U64(u) & 0x000fffffffffffffLL) == 0)) ? 1:0
#else
#define MPL_isinf64(u) \
( (( MPL_U64(u) & 0x7ff0000000000000i64) == 0x7ff0000000000000i64) && ((MPL_U64(u) & 0x000fffffffffffffi64) == 0)) ? 1:0
#endif
#endif /* MPL_isinf64 */
#if !defined(MPL_isfinite64)
#if !defined(_MSC_VER)
#define MPL_isfinite64(u) \
( (( MPL_U64(u) & 0x7ff0000000000000LL) != 0x7ff0000000000000LL)) ? 1:0
#else
#define MPL_isfinite64(u) \
( (( MPL_U64(u) & 0x7ff0000000000000i64) != 0x7ff0000000000000i64)) ? 1:0
#endif
#endif /* MPL_isfinite64 */
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.