ieeePrecision

Tests the precision of floating-point type F.

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

If F is a $(D_KEYWORD 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).

Members

Variables

ieeePrecision
enum IEEEPrecision ieeePrecision;
Undocumented in source.
ieeePrecision
enum IEEEPrecision ieeePrecision;
Undocumented in source.
ieeePrecision
enum IEEEPrecision ieeePrecision;
Undocumented in source.
ieeePrecision
enum IEEEPrecision ieeePrecision;
Undocumented in source.

Parameters

F

Type to be tested.

Return Value

Precision according to IEEE-754.

Examples

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

See Also

$(D_PSYMBOL IEEEPrecision).

Meta