IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: 1.0.0b1
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

ldexp

ldexp[dtype: DType, width: Int, //](x: SIMD[dtype, width], exp: SIMD[DType.int32, width]) -> SIMD[dtype, width] where dtype.is_floating_point()

Computes elementwise ldexp function.

The ldexp function multiplies a floating point value x by the number 2 raised to the exp power. I.e. ldexp(x,exp)ldexp(x,exp) calculate the value of x2expx * 2^{exp} and is used within the erferf function.

Parameters:

  • dtype (DType): The dtype of the input and output SIMD vector.
  • width (Int): The width of the input and output SIMD vector.

Args:

Returns:

SIMD[dtype, width]: Vector containing elementwise result of ldexp on x and exp.