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:
Richard Harrison 2019-12-29 13:50:21 +01:00
parent 1eadaa4cda
commit ba7134c2a2

View File

@ -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)