History

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.

Michael Matz committed 8 years ago

Commit 9e47b181 parent 3b27b3b1 file · +8 −7Browse files

Unified · Split

tccgen.c+8−7
@@ -5051,17 +5051,18 @@ ST_FUNC void unary(void) · 5050 unmodified lines
5051 }5051 }
5052 // special qnan , snan and infinity values5052 // special qnan , snan and infinity values
5053 case TOK___NAN__:5053 case TOK___NAN__:
5054 vpush64(VT_DOUBLE, 0x7ff8000000000000ULL);5054 n = 0x7fc00000;
5055special_math_val:
5056 vpushi(n);
5057 vtop->type.t = VT_FLOAT;
5055 next();5058 next();
5056 break;5059 break;
5057 case TOK___SNAN__:5060 case TOK___SNAN__:
5058 vpush64(VT_DOUBLE, 0x7ff0000000000001ULL);5061 n = 0x7f800001;
5059 next();5062 goto special_math_val;
5060 break;
5061 case TOK___INF__:5063 case TOK___INF__:
5062 vpush64(VT_DOUBLE, 0x7ff0000000000000ULL);5064 n = 0x7f800000;
5063 next();5065 goto special_math_val;
5064 break;
5065 5066
5066 default:5067 default:
5067 tok_identifier:5068 tok_identifier:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t