Class std::Int
Implements Comparable<Int>
Instances of the Int class are integers. Each integer object is either negative, zero or positive. Their range is essentially unlimited: they can represent both very large and very small integers with thousands of digits.
Integer literals and arithmetic operations are the most common ways of constructing integer objects. Besides arithmetic, integers are also used for indexing strings and arrays.
 class Int(x[, base as Int])

Construct an object of the Int type. Call the _int()
method of the first argument and return a value equal to the result,
provided that it is an integer. Of the primitive types, Str and
Float objects provide an _int method. Float arguments are
converted to integers by truncating any fractions. String arguments may
contain optional blank and tab characters before and after the number,
and the number must be in base 10 (decimal) by default.
The base argument is only valid for conversions from strings. It specifies the base of the string, overriding the default base 10. Valid values are from 2 to 36, inclusive. Digit values greater than 9 are represented as letters from "a" to "z", such that "a" or "A" is 10, "b" or "B" is 11, etc.
See also: string::IntToStr can be used to convert integers to strings in different bases.
See also: Float objects also define operations that accept integer operands. For example, 1.5 + 2 evaluates to 3.5, as expected.
Operations
Int objects support the following operations (n below refers to an Int value):
 n + x (Int + Int ⇒ Int; Int + Float ⇒ Float)
 Perform an addition operation. If x is an integer, the result is also an integer, and if x is a float, the result is a float.
 n + x (Int + Addable<Int, T> ⇒ T)
 If x is neither an integer or a float, return x + n (switch operands).
 n * x (Int * Int ⇒ Int; Int * Float ⇒ Float)
 Perform a multiplication operation. If x is an integer, the result is also an integer, and if x is a float, the result is a float.
 n * x (Int + Multipliable<Int, T> ⇒ T)
 If x is neither an integer or a float, return x * n (switch operands).
 n  x (Int  Int ⇒ Int; Int  Float ⇒ Float)
 Perform a subtraction operation. If x is an integer, the result is also an integer, and if x is a float, the result is a float.
 n / x (Int / Int ⇒ Float; Int / Float ⇒ Float)
 Perform a division operation. The right operand x may be an integer or a float. The result will always be a float.
 n div x (Int div Int ⇒ Int; Int div Float ⇒ Int)
 Return n divided by x, rounded down to the nearest integer. If x is an integer, the result is an integer, and if x is a float, the result is a float.
 n mod x (Int mod Int ⇒ Int; Int mod Float ⇒ Float)

Perform a modulus operation. The result is chosen so that
(n div x) * x + n mod x == n
(the equality is only
approximate for a floating point operand x). If x is
an integer, the result is an integer, and if x is a
float, the result is a float.
7 div 3  2 4 div 3  2
 n ** x (Int ** Int ⇒ Int; Int ** Float ⇒ Float)

Return n^{x}, i.e., n raised to the
xth
power. If x is an integer, the result is an integer, and if
x is a float, the result is a float.
The operator
follows the following rules in special conditions:
 0 ** 0 == 1
 0 ** 0.0 == 1.0
 If x is a negative integer, raise ArithmeticError.
 If n < 0 and x is not an integer, raise ArithmeticError.
 n (Int ⇒ Int)
 Return the negation of an integer.
 n == x (Int == Object ⇒ Boolean)

Integers can be compared for equality with arbitrary objects.
An integer object is equal to an equivalent integer or float value.
If x is neither an integer nor a float,
the operation is evaluated as x == n instead.
Note: The last property enables userdefined types to be compared with integers usefully.
 n < x (Int < Int ⇒ Boolean; Int < Float ⇒ Boolean)
 n > x (Int > Int ⇒ Boolean; Int > Float ⇒ Boolean)

Integers can be compared for order with integers and floats.
If x is neither an integer nor a float,
the operation is evaluated as x > n
(for a < operation) or x < n (for a > operation).
Note: The last property allows userdefined types to be compared with integers usefully.
 Str(n)
 Convert an integer to a string in base 10 (decimal).
 Float(n)
 Convert an integer to a float.
 Hash(n)
 Return the hash value of an integer.