0
|
1 module dmd.Port;
|
|
2
|
114
|
3 import dmd.common;
|
0
|
4 import core.stdc.math;
|
|
5
|
|
6 struct Port
|
|
7 {
|
|
8 static int isSignallingNan(double r)
|
|
9 {
|
|
10 /* A signalling NaN is a NaN with 0 as the most significant bit of
|
|
11 * its significand, which is bit 51 of 0..63 for 64 bit doubles.
|
|
12 */
|
|
13 return isnan(r) && !(((cast(ubyte*)&r)[6]) & 8);
|
|
14 }
|
|
15
|
|
16 static int isSignallingNan(ref real r)
|
|
17 {
|
|
18 /* A signalling NaN is a NaN with 0 as the most significant bit of
|
|
19 * its significand, which is bit 62 of 0..79 for 80 bit reals.
|
|
20 */
|
|
21 return isnan(r) && !(((cast(ubyte*)&r)[7]) & 0x40);
|
|
22 }
|
|
23 } |