tango.math.IEEE

Members

Aliases

FP_ILOGB0
alias FP_ILOGB0 = tango.stdc.math.FP_ILOGB0
Undocumented in source.
FP_ILOGBNAN
alias FP_ILOGBNAN = tango.stdc.math.FP_ILOGBNAN
Undocumented in source.

Enums

PrecisionControl
enum PrecisionControl
Undocumented in source.
RoundingMode
enum RoundingMode

IEEE rounding modes. The default mode is ROUNDTONEAREST.

TANGO_NAN
enum TANGO_NAN
Undocumented in source.

Functions

NaN
real NaN(ulong payload)

Create a NaN, storing an integer inside the payload.

copysign
real copysign(real to, real from)

Return a value composed of to with from's sign bit.

expi
creal expi(real y)

Calculate cos(y) + i sin(y).

fabs
real fabs(real x)

Returns |x|

fdim
real fdim(real x, real y)

Returns the positive difference between x and y.

feqrel
int feqrel(X x, X y)

To what precision is x equal to y?

fma
real fma(float x, float y, float z)

Returns (x * y) + z, rounding only once according to the current rounding mode.

frexp
real frexp(real value, int exp)

Separate floating point value into significand and exponent.

getIeeeRounding
RoundingMode getIeeeRounding()

Get the IEEE rounding mode which is in use.

getNaNPayload
ulong getNaNPayload(real x)

Extract an integral payload from a NaN.

ieeeMean
T ieeeMean(T x, T y)

Return the value that lies halfway between x and y on the IEEE number line.

ilogb
int ilogb(real x)

Extracts the exponent of x as a signed integral value.

isIdentical
bool isIdentical(real x, real y)
bool isIdentical(ireal x, ireal y)
bool isIdentical(creal x, creal y)

Is the binary representation of x identical to y?

isInfinity
int isInfinity(real x)

Return !=0 if e is $(PLUSMNINF);.

isNaN
int isNaN(real x)

Returns !=0 if e is a NaN.

isNormal
int isNormal(X x)

Returns !=0 if x is normalized.

isSubnormal
int isSubnormal(float f)
int isSubnormal(double d)
int isSubnormal(real x)

Is number subnormal? (Also called "denormal".) Subnormals have a 0 exponent and a 0 most significant significand bit, but are non-zero.

isZero
int isZero(real x)

Return !=0 if x is ±0.

ldexp
real ldexp(real n, int exp)

Compute n * 2$(SUP exp) References: frexp

logb
real logb(real x)

Extracts the exponent of x as a signed integral value.

nextDoubleDown
double nextDoubleDown(double x)

Calculate the next smallest floating point value before x.

nextDoubleUp
double nextDoubleUp(double x)

Calculate the next largest floating point value after x.

nextDown
real nextDown(real x)
nextFloatDown
float nextFloatDown(float x)

Calculate the next smallest floating point value before x.

nextFloatUp
float nextFloatUp(float x)

Calculate the next largest floating point value after x.

nextUp
real nextUp(real x)

Calculate the next largest floating point value after x.

nextafter
real nextafter(real x, real y)

Calculates the next representable value after x in the direction of y.

reduceRealPrecision
PrecisionControl reduceRealPrecision(PrecisionControl prec)

Set the number of bits of precision used by 'real'.

resetIeeeFlags
void resetIeeeFlags()

Set all of the floating-point status flags to false.

scalbn
real scalbn(real x, int n)

Efficiently calculates x * 2$(SUP n).

setIeeeRounding
RoundingMode setIeeeRounding(RoundingMode roundingmode)

Change the rounding mode used for all floating-point operations.

signbit
int signbit(real x)

Return 1 if sign bit of e is set, 0 if not.

splitSignificand
X splitSignificand(X x)

Reduces the magnitude of x, so the bits in the lower half of its significand are all zero. Returns the amount which needs to be added to x to restore its initial value; this amount will also have zeros in all bits in the lower half of its significand.

Properties

ieeeFlags
IeeeFlags ieeeFlags [@property getter]

Return a snapshot of the current state of the floating-point status flags.

Structs

IeeeFlags
struct IeeeFlags

IEEE exception status flags

Variables

FP_ILOGB0
enum int FP_ILOGB0;
Undocumented in source.
FP_ILOGBINFINITY
enum int FP_ILOGBINFINITY;
Undocumented in source.
FP_ILOGBINFINITY
enum int FP_ILOGBINFINITY;
Undocumented in source.
FP_ILOGBNAN
enum int FP_ILOGBNAN;
Undocumented in source.

Meta