Skip to main content

trait

Powable

The Powable trait describes a type that defines a power operation (i.e. exponentiation) with the same base and exponent types.

Types that conform to Powable will work with the builtin pow function, which will return the same type as the inputs.

TODO: add example

Implemented traits

AnyType

Methods

__pow__

__pow__(self: T, exp: T) -> T

Return the value raised to the power of the given exponent.

Args:

  • exp (T): The exponent value.

Returns:

The value of self raised to the power of exp.