funcpi
func pi(): float
math: square roots, angles, powers, rounding, smallest and largest, and random numbers. use "math.jamo"
The random generator keeps its state in math_state, and math_seeded says whether it has been seeded yet.
The generator is a 64-bit LCG with Knuth's MMIX numbers, which wraps the way Jamo's ints do. Jamo has no bit operators, so xorshift would be slow. An LCG's low bits repeat quickly, so only the top 32 bits of each step are used.
func pi(): float
func abs(value: float): float
The size of a float, without its sign
func abs_int(value: int): int
The size of an int, without its sign. The smallest int has no positive partner, so it comes back as it is
func math_check_fits(value: float, name: string)
func floor(value: float): int
The nearest int at or below
func ceil(value: float): int
The nearest int at or above
func round(value: float): int
The nearest int. Halves round away from zero, so 2.5 gives 3 and -2.5 gives -3
func min(a: float, b: float): float
func max(a: float, b: float): float
func clamp(value: float, low: float, high: float): float
func lerp(a: float, b: float, part: float): float
The value part of the way from a to b: lerp(0.0, 10.0, 0.25) is 2.5. Past 0.0 to 1.0 it goes beyond them
func min_int(a: int, b: int): int
func max_int(a: int, b: int): int
func clamp_int(value: int, low: int, high: int): int
func random_seed(seed: int)
Starts the same numbers over again: the same seed always gives the same numbers
func math_seed_from_clock()
func math_top_bits(value: int): int
The top 32 bits of a 64-bit value, as a number from 0 to 4294967295
func math_random_bits(): int
The generator's next 32 random bits
func random_int(low: int, high: int): int
A whole number from low to high, both included. Every number is equally likely
func random_float(): float
A float from 0.0 up to, but not including, 1.0
func pick<T>(items: [T]): T
One item, picked at random
func shuffle<T>(items: [T])
Puts the items in a random order, in place, with every order as likely (Fisher-Yates)