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