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:
parent
3b27b3b1d1
commit
9e47b18229
1 changed files with 8 additions and 7 deletions
15
tccgen.c
15
tccgen.c
|
|
@ -5051,17 +5051,18 @@ ST_FUNC void unary(void)
|
||||||
}
|
}
|
||||||
// special qnan , snan and infinity values
|
// special qnan , snan and infinity values
|
||||||
case TOK___NAN__:
|
case TOK___NAN__:
|
||||||
vpush64(VT_DOUBLE, 0x7ff8000000000000ULL);
|
n = 0x7fc00000;
|
||||||
|
special_math_val:
|
||||||
|
vpushi(n);
|
||||||
|
vtop->type.t = VT_FLOAT;
|
||||||
next();
|
next();
|
||||||
break;
|
break;
|
||||||
case TOK___SNAN__:
|
case TOK___SNAN__:
|
||||||
vpush64(VT_DOUBLE, 0x7ff0000000000001ULL);
|
n = 0x7f800001;
|
||||||
next();
|
goto special_math_val;
|
||||||
break;
|
|
||||||
case TOK___INF__:
|
case TOK___INF__:
|
||||||
vpush64(VT_DOUBLE, 0x7ff0000000000000ULL);
|
n = 0x7f800000;
|
||||||
next();
|
goto special_math_val;
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
tok_identifier:
|
tok_identifier:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue