Multiply values by powers of two using a separate exponent operand.
Numeric.math.ldexp(first, right = 0)Combines operands with NumPy style broadcast.
- Parameters:
first: Mantissa operand as a scalar, vector, or matrixright: Exponent operand as a scalar, vector, or matrix
- Returns: Scaled values matching the broadcast shape of the operands
- NumPy: Equivalent to
np.ldexp.
import Numeric from '@neabyte/numerix'
const value = Numeric.math.ldexp(3, 2)
console.log(value)
// 12import Numeric from '@neabyte/numerix'
const values = Numeric.math.ldexp([1, 2], [3, 4])
console.log(values)
// [8,32]import Numeric from '@neabyte/numerix'
const value = Numeric.math.ldexp(3)
console.log(value)
// 3import Numeric from '@neabyte/numerix'
const parts = Numeric.math.frexp(12)
const value = Numeric.math.ldexp(parts[0], parts[1])
console.log(value)
// 12