OxL Reference

method u8.pow

Power by repeated squaring; panics on overflow like *.

Example:

oxl✓ checked in CI
fn main() io {
  let two: u8 = 2
  print("{two.pow(5)} {two.pow(0)}")
}
Output
32 1
pub(api) fn pow(e: u32) -> u8

Complexity. O(log e).

Since. 1.0.0-beta

Parameters

NameType
eu32

Returns

u8

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/numbers.oxl:3275

See also