Skip to main content
Log in

Mojo function

pow

pow[T: Powable](base: T, exp: T) -> $0

Computes the base raised to the power of the exp.

Parameters:

  • ​T (Powable): A type conforming to the Powable trait.

Args:

  • ​base (T): The base of the power operation.
  • ​exp (T): The exponent of the power operation.

Returns:

The base raised to the power of the exp.

pow(base: SIMD[type, size], exp: Int) -> SIMD[$0, $1]

Computes elementwise value of a SIMD vector raised to the power of the given integer.

Args:

  • ​base (SIMD[type, size]): The first input argument.
  • ​exp (Int): The second input argument.

Returns:

The base elementwise raised raised to the power of exp.

Was this page helpful?