Check for NaN/infinite values in s48_double_to_bignum
parent
e8ddc09ab5
commit
f0d353558e
|
@ -421,6 +421,7 @@ s48_bignum_to_double(bignum_type bignum)
|
||||||
bignum_type
|
bignum_type
|
||||||
s48_double_to_bignum(double x)
|
s48_double_to_bignum(double x)
|
||||||
{
|
{
|
||||||
|
if (!isnormal(x)) return (BIGNUM_ZERO ());
|
||||||
int exponent;
|
int exponent;
|
||||||
double significand = (frexp (x, (&exponent)));
|
double significand = (frexp (x, (&exponent)));
|
||||||
if (exponent <= 0) return (BIGNUM_ZERO ());
|
if (exponent <= 0) return (BIGNUM_ZERO ());
|
||||||
|
|
Loading…
Reference in New Issue