File tree 2 files changed +23
-1
lines changed
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,21 @@ typedef double double_t;
57
57
#define HUGE_VALD ((double)INFINITY)
58
58
#define HUGE_VALF ((float)INFINITY)
59
59
#define HUGE_VALL ((long double)INFINITY)
60
- #define NAN ((float)(INFINITY * 0.0F))
60
+ #ifndef _UCRT_NEGATIVE_NAN
61
+ // This operation creates a negative NAN adding a - to make it positive
62
+ #ifdef _MSC_VER
63
+ #define NAN (-(float)(INFINITY * 0.0F))
64
+ #else
65
+ #define NAN (__builtin_nanf(""))
66
+ #endif
67
+ #else
68
+ // Keep this for backwards compatibility
69
+ #ifdef _MSC_VER
70
+ #define NAN ((float)(INFINITY * 0.0F))
71
+ #else
72
+ #define NAN (-__builtin_nanf(""))
73
+ #endif
74
+ #endif
61
75
62
76
#define _DENORM (-2)
63
77
#define _FINITE (-1)
Original file line number Diff line number Diff line change @@ -91,10 +91,18 @@ _CRT_BEGIN_C_HEADER
91
91
#define HUGE_VALL ((long double )INFINITY)
92
92
#ifndef _UCRT_NEGATIVE_NAN
93
93
// This operation creates a negative NAN adding a - to make it positive
94
+ #ifdef _MSC_VER
94
95
#define NAN (-(float )(INFINITY * 0 .0F ))
95
96
#else
97
+ #define NAN (__builtin_nanf(" " ))
98
+ #endif
99
+ #else
96
100
// Keep this for backwards compatibility
101
+ #ifdef _MSC_VER
97
102
#define NAN ((float )(INFINITY * 0 .0F ))
103
+ #else
104
+ #define NAN (-__builtin_nanf(" " ))
105
+ #endif
98
106
#endif
99
107
100
108
#define _DENORM (-2 )
You can’t perform that action at this time.
0 commit comments