std.math.traits

This is a submodule of std.math.

It contains several functions for introspection on numerical values.

Members

Functions

copysign
R copysign(X to, R from)
copysign
R copysign(R to, X from)
isFinite
bool isFinite(X x)

Determines if x is finite.

isIdentical
bool isIdentical(real x, real y)

Is the binary representation of x identical to y?

isInfinity
bool isInfinity(X x)

Determines if x is ±∞.

isNaN
bool isNaN(X x)

Determines if x is NaN.

isNormal
bool isNormal(X x)

Determines if x is normalized.

isPowerOf2
bool isPowerOf2(X x)

Check whether a number is an integer power of two.

isSubnormal
bool isSubnormal(X x)

Determines if x is subnormal.

sgn
F sgn(F x)

Returns -1 if x < 0, x if x == 0, 1 if x > 0, and NaN if x==NaN.

signbit
int signbit(X x)

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

Meta

Authors

Walter Bright, Don Clugston, Conversion of CEPHES math library to D by Iain Buclaw and David Nadlinger