math.ldexp() function

The math.ldexp() function is the inverse of math.frexp(). It returns frac × 2**exp.

*Output data type: Float*

  1. import "math"
  2. math.ldexp(frac: 0.5, exp: 6)
  3. // Returns 32.0

Parameters

frac

The fraction used in the operation.

*Data type: Float*

exp

The exponent used in the operation.

*Data type: Integer*

Special cases

  1. math.ldexp(frac: ±0, exp:exp) // Returns ±0
  2. math.ldexp(frac: ±Inf, exp:exp) // Returns ±Inf
  3. math.ldexp(frac: NaN, exp:exp) // Returns NaN