Math
Arithmetic operators and numeric functions.
AbsExpression
Returns the absolute value of self.
Signature
txt
Number::abs () : NumberExample
txt
-2.abs() = 2AdditionExpression
Addition operator.
Symbol: +
Example
txt
1 + 2DivExpression
Returns the integer quotient of the division of self by i.
Signature
txt
Number::div ( i : Number ) : NumberExample
txt
3 div 2 = 1DivideExpression
Division operator.
Symbol: /
Example
txt
17 / 2MaxExpression
Returns the greatest of self and i.
Signature
txt
Number::max ( i : Number ) : NumberExample
txt
6.max(3) = 6MinExpression
Returns the lowest of self and i.
Signature
txt
Number::min ( i : Number ) : NumberExample
txt
6.min(3) = 3ModuloExpression
Returns the remainder of the division of self by i.
Signature
txt
Number::mod ( i : Number ) : NumberExample
txt
4 mod 2 = 0MultiplyExpression
Multiplication operator.
Symbol: *
Example
txt
1 * 2PowerExpression
Power operator.
Symbol: ^
Example
txt
4 ^ 2RoundExpression
Returns the nearest integer to self.
Signature
txt
Number::round () : NumberSqrtExpression
Returns the square root of self.
Signature
txt
Number::sqrt () : NumberExample
txt
9.sqrt() = 3SubstractionExpression
Subtraction operator.
Symbol: -
Example
txt
1 - 2