File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -1226,7 +1226,7 @@ private elem* elmin(elem* e, Goal goal)
12261226 }
12271227
12281228 // Replace (e - e) with (0)
1229- if (el_match(e1,e2) && ! el_sideeffect(e1))
1229+ if (el_match(e1,e2) && ! el_sideeffect(e1) && ! tyfloating(tym) )
12301230 {
12311231 el_free(e);
12321232 e = el_calloc();
Original file line number Diff line number Diff line change 1+ /*
2+ REQUIRED_ARGS: -inline -O
3+ RUN_OUTPUT:
4+ ---
5+ 32767
6+ 32767
7+ ---
8+ */
9+
10+ enum ushort EXPMASK = 0x7FFF ;
11+
12+ version (LittleEndian )
13+ enum EXPPOS_SHORT = 4 ;
14+ else
15+ enum EXPPOS_SHORT = 0 ;
16+
17+ int getExp (real x, real y)
18+ {
19+ real diff = x - y;
20+ ushort * pa = cast (ushort * )(&x);
21+ ushort * pb = cast (ushort * )(&y);
22+ ushort * pd = cast (ushort * )(&diff);
23+ return pd[EXPPOS_SHORT ] & EXPMASK ;
24+ }
25+
26+ void main ()
27+ {
28+ import core.stdc.stdio ;
29+ printf(" %d\n " , getExp(real .nan, real .nan));
30+ printf(" %d\n " , getExp(real .nan, real .nan));
31+ }
You can’t perform that action at this time.
0 commit comments