mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
dtoolbase: Fix bad double-prec NaN/inf detection in release build
Fixes #987 Closes #988
This commit is contained in:
parent
c7341bec26
commit
9f0fc0a594
@ -351,7 +351,7 @@ cnan(double v) {
|
||||
#if __FINITE_MATH_ONLY__
|
||||
// GCC's isnan breaks when using -ffast-math.
|
||||
union { double d; uint64_t x; } u = { v };
|
||||
return ((u.x << 1) > 0xff70000000000000ull);
|
||||
return ((u.x << 1) > 0xffe0000000000000ull);
|
||||
#elif !defined(_WIN32)
|
||||
return std::isnan(v);
|
||||
#else
|
||||
@ -383,7 +383,7 @@ cinf(double v) {
|
||||
#if __FINITE_MATH_ONLY__
|
||||
// GCC's isinf breaks when using -ffast-math.
|
||||
union { double d; uint64_t x; } u = { v };
|
||||
return ((u.x << 1) == 0xff70000000000000ull);
|
||||
return ((u.x << 1) == 0xffe0000000000000ull);
|
||||
#elif !defined(_WIN32)
|
||||
return std::isinf(v);
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user