Pudu programming language
Menu
API reference

Std.Num.small

1 declaration

fn

small: &T -> Int -> T where T: Zero + One + Add

This is a callable function.

What it does

A whole number of the caller's type, built by repeated addition.

Only for the small constants an algorithm needs — ten for digits, two for

halving. Building a large one this way would be a loop a caller can see.

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.
  • & borrows a value for this call instead of moving or copying it.

Back to Std.NumSearch related declarations