math.exp2() function

The math.exp2() function returns 2**x, the base-2 exponential of x.

*Output data type: Float*

  1. import "math"
  2. math.exp2(x: 21.0)
  3. // Returns 2.097152e+06

Parameters

x

The value used in the operation.

*Data type: Float*

Special cases

  1. math.exp2(x: +Inf) // Returns +Inf
  2. math.exp2(x: NaN) // Returns NaN

Very large values overflow to 0 or +Inf. Very small values underflow to 1.