Number
A number value is a 64-bit floating-point number, such as 3.14, 42,
or 1.234e6.
let x be 42
let y be 3.14
print x + y # 45.14Definition
A number value can be defined using any integer number as its value.
let x be 42Or any floating-point number as its value.
let y be 3.14Scientific notation is also supported using e as the exponent separator.
let z be 1.234e6 # 1.234 * 10^6Usage
As long as the numbers are mathematically equal, the number of decimal places is irrelevant,
for example, 42 and 42.0 are equal.
Arithmetic operations can be performed on numbers, such as multiplication, division, exponentiation, followed by addition, subtraction, and modulo.
let some_number be 12 plus 3 times 4 minus 5 raised to 2 # 12 + 3 * 4 - 5 ^ 2
print some_number # -1Methods
Returns a string representation of the number, e.g. "3.14", "42".
let x be 3.14
let string be call x's to_string
print string # 3.14Returns a number rounded to the nearest integer.
let x be 3.14
let rounded be call x's to_round
print rounded # 3Returns a number rounded down to the nearest integer.
let x be 3.14
let floored be call x's to_floor
print floored # 3Returns a number rounded up to the nearest integer.
let x be 3.14
let ceiled be call x's to_ceiling
print ceiled # 4Returns a number clamped between min and max, inclusive.
let x be 3.14
let clamped be call x's to_clamped with 5, and 10
print clamped # 5