exp2

Calculates 2x.

Special Values
xexp2(x)
+∞+∞
-∞+0.0
NaNNaN
  1. real exp2(real x)
    pragma(inline, true) @nogc @trusted pure nothrow
    real
    exp2
    (
    real x
    )
  2. double exp2(double x)
  3. float exp2(float x)

Examples

import std.math.traits : isIdentical;
import std.math.operations : feqrel;

assert(isIdentical(exp2(0.0), 1.0));
assert(exp2(2.0).feqrel(4.0) > 16);
assert(exp2(8.0).feqrel(256.0) > 16);

Meta