License:
Authors:
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | real a=3.5; // Set all the flags to zero resetIeeeFlags(); assert(!ieeeFlags.divByZero); // Perform a division by zero. a/=0.0L; assert(a==real.infinity); assert(ieeeFlags.divByZero); // Create a NaN a*=0.0L; assert(ieeeFlags.invalid); assert(isNaN(a)); // Check that calling func() has no effect on the // status flags. IeeeFlags f = ieeeFlags; func(); assert(ieeeFlags == f); |
Returns:
Returns:
value | returns | exp |
---|---|---|
±0.0 | ±0.0 | 0 |
+∞ | +∞ | int.max |
-∞ | -∞ | int.min |
±NAN | ±NAN | int.min |
References:
Remarks:
x | ilogb(x) | Invalid? |
---|---|---|
0 | FP_ILOGB0 | yes |
±∞ | FP_ILOGBINFINITY | yes |
NAN | FP_ILOGBNAN | yes |
x | logb(x) | divide by 0? |
---|---|---|
±∞ | +∞ | no |
±0.0 | -∞ | yes |
x | scalb(x) |
---|---|
±∞ | ±∞ |
±0.0 | ±0.0 |
Returns:
Arguments | fdim(x, y) |
---|---|
x > y | x - y |
x <= y | +0.0 |
x | fabs(x) |
---|---|
±0.0 | +0.0 |
±∞ | +∞ |
Bugs:
)x | nextUp(x) |
---|---|
-∞ | -real.max |
±0.0 | real.min*real.epsilon |
real.max | ∞ |
∞ | ∞ |
NAN | NAN |
Remarks:
x | nextDown(x) |
---|---|
∞ | real.max |
±0.0 | -real.min*real.epsilon |
-real.max | -∞ |
-∞ | -∞ |
NAN | NAN |
Remarks:
Remarks:
Returns:
x | y | feqrel(x, y) |
---|---|---|
x | x | typeof(x).mant_dig |
x | >= 2*x | 0 |
x | <= x/2 | 0 |
NAN | any | 0 |
any | NAN | 0 |
Remarks:
Note:
Returns: