Enum member ieeePrecision

Tests the precision of floating-point type F.

enum ieeePrecision(F) = IEEEPrecision.single;

For float ieeePrecision always evaluates to IEEEPrecision.single; for double - to IEEEPrecision.double. It returns different values only for real, since real is a platform-dependent type.

If F is a real and the target platform isn't currently supported, static assertion error will be raised (you can use is(typeof(ieeePrecision!F)) for testing the platform support without a compilation error).

Parameters

NameDescription
F Type to be tested.

Returns

Precision according to IEEE-754.

See Also

IEEEPrecision.

Example

static assert(ieeePrecision!float == IEEEPrecision.single);
static assert(ieeePrecision!double == IEEEPrecision.double_);