=begin pod =TITLE class Int class Int is Cool does Real { ... } C objects store integral numbers of arbitrary size. Cs are immutable. There are two main syntax forms for C literals 123 # Int in decimal notation :16 # Int in radix notations Both forms allow underscores between any two digits which can serve as visual separators, but don't carry any meaning: 5_00000 # five Lakhs 500_000 # five hundred thousand =head1 Methods =head2 chr multi sub chr(Int:D ) returns Str:D multi method chr(Int:D:) returns Str:D Returns a one-character string, by interpreting the integer as a Unicode codepoint number and converting it the corresponding character. =head1 Operators =head2 div multi sub infix:
(Int:D, Int:D) returns Int:D Does an integer division, rounded down. =head2 expmod multi sub expmod (Int:D: Int $y, Int $mod) returns Int:D multi method expmod (Int:D: Int $y, Int $mod) returns Int:D Returns the given C raised to the C<$y> power within modulus C<$mod>. =head2 is-prime multi sub is-prime (Int:D: Int $tries = 100) returns Bool:D multi method is-prime (Int:D: Int $tries = 100) returns Bool:D Returns C if this C is known to be a prime, or is likely to be a prime based on a probabalistic Miller-Rabin test. C<$tries> is the maximal number of iterations the test is allowed to do. Returns C if this C is known not to be a prime. =end pod