exp2

Calculates 2x

@IEEECompliant("exp2", 42)
D
exp2
(
D
)
(
auto const ref D x
)

Throws

InvalidOperationExceptionx is signaling NaN
UnderflowException2x is too small to be represented
OverflowException2x is too big to be represented
InexactExceptionthe result is inexact

Special values

xexp2(x)
NaNNaN
±0.0+1.0
-∞+0.0
+∞+∞

Examples

decimal32 x = 3;
assert(exp2(x) == 8);

Meta