Skip to main content
Log in

Mojo function

exp2

exp2[dtype: DType, width: Int, //](x: SIMD[dtype, width]) -> SIMD[dtype, width]

Computes elementwise 2 raised to the power of n, where n is an element of the input SIMD vector.

Parameters:

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

Args:

  • x (SIMD[dtype, width]): SIMD vector to perform exp2 on.

Returns:

Vector containing 2n2^n computed elementwise, where n is an element in the input SIMD vector.