Pudu programming language
Menu
API reference

Std.Math.pow

1 declaration

fn

pow: T -> Int -> T where T: One + Mul

This is a callable function.

What it does

A value raised to a non-negative power, by repeated squaring.

A negative exponent yields one, matching integer exponentiation everywhere

else: the true answer is not a whole number, and this signature promises one.

The exponent is a plain count, because it says how many times rather than

naming a value of the base's type.

Read the signature

  • The text after the name is the type checked by Pudu.
  • Read arrows from left to right: inputs come first, and the final type is returned.

Back to Std.MathSearch related declarations