Use isfinite to determine if an FP number is valid.
ref: https://forum.flightgear.org/viewtopic.php?f=30&t=36600&sid=4bdfcb69abb4a6440cd8965aa03815d5#p357164
This commit is contained in:
parent
1eadaa4cda
commit
ba7134c2a2
@ -9,9 +9,7 @@
|
|||||||
|
|
||||||
static int valid(double d)
|
static int valid(double d)
|
||||||
{
|
{
|
||||||
union { double d; unsigned long long ull; } u;
|
return isfinite(d);
|
||||||
u.d = d;
|
|
||||||
return ((u.ull >> 52) & 0x7ff) != 0x7ff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static naRef die(naContext c, const char* fn)
|
static naRef die(naContext c, const char* fn)
|
||||||
|
Loading…
Reference in New Issue
Block a user