std.math.traits

This is a submodule of std.math.

It contains several functions for introspection on numerical values.

Types 1

ieeeHalf
ieeeSingle
ieeeDouble
ieeeExtended
ieeeExtended53
ibmExtended
ieeeQuadruple

Functions 11

fnbool isNaN(X)(X x) if (isFloatingPoint!(X)) @nogc @trusted pure nothrowDetermines if x is NaN. Params: x = a floating point number. Returns: `true` if x is Nan.
fnbool isFinite(X)(X x) @trusted pure nothrow @nogcDetermines if x is finite. Params: x = a floating point number. Returns: `true` if x is finite.
fnbool isNormal(X)(X x) @trusted pure nothrow @nogcDetermines if x is normalized.
fnbool isSubnormal(X)(X x) @trusted pure nothrow @nogcDetermines if x is subnormal.
fnbool isInfinity(X)(X x) if (isFloatingPoint!(X)) @nogc @trusted pure nothrowDetermines if x is . Params: x = a floating point number. Returns: `true` if x is .
fnbool isIdentical(real x, real y) @trusted pure nothrow @nogcIs the binary representation of x identical to y?
fnint signbit(X)(X x) @nogc @trusted pure nothrowReturn 1 if sign bit of e is set, 0 if not.
fnR copysign(R, X)(R to, X from) if (isFloatingPoint!(R) && isFloatingPoint!(X)) @trusted pure nothrow @nogcParams: to = the numeric value to use from = the sign value to use Returns: a value composed of to with from's sign bit.
fnR copysign(R, X)(X to, R from) if (isIntegral!(X) && isFloatingPoint!(R)) @trusted pure nothrow @nogcditto
fnF sgn(F)(F x) if (isFloatingPoint!F || isIntegral!F) @safe pure nothrow @nogcReturns `-1` if x < 0, `x` if x == 0, `1` if x > 0, and if x==.
fnbool isPowerOf2(X)(const X x) if (isNumeric!X) pure @safe nothrow @nogcCheck whether a number is an integer power of two.

Templates 1

tmplfloatTraits(T)