Pudu programming language
Menu
API reference

Std.Math.isqrt

1 declaration

fn

isqrt: T -> Option[T] where T: Ord + Zero + One + Add + Div

This is a callable function.

What it does

The greatest value whose square does not exceed the given one.

Newton's method on whole numbers; a negative value has no square root and

answers None rather than a number that is not one.

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.
  • Names inside [ ] are type arguments, such as the item type held by a collection.
  • Option holds Some(value) or None when no value is available.

Back to Std.MathSearch related declarations