Make type of __nan__ __inf__ and __snan__ be float

so that those builtins can be used directly for the C99 NAN and
INFINITY math.h macros.
This commit is contained in:
Michael Matz 2017-12-24 13:16:09 +01:00
parent 3b27b3b1d1
commit 9e47b18229

View File

@ -5051,17 +5051,18 @@ ST_FUNC void unary(void)
}
// special qnan , snan and infinity values
case TOK___NAN__:
vpush64(VT_DOUBLE, 0x7ff8000000000000ULL);
n = 0x7fc00000;
special_math_val:
vpushi(n);
vtop->type.t = VT_FLOAT;
next();
break;
case TOK___SNAN__:
vpush64(VT_DOUBLE, 0x7ff0000000000001ULL);
next();
break;
n = 0x7f800001;
goto special_math_val;
case TOK___INF__:
vpush64(VT_DOUBLE, 0x7ff0000000000000ULL);
next();
break;
n = 0x7f800000;
goto special_math_val;
default:
tok_identifier: