Core typesmath
Constants
math.pi, math.tau and math.e: their values and type.
| Name | Value |
|---|---|
math.pi | 3.141592653589793 |
math.tau | 6.283185307179586, that is 2 * pi |
math.e | 2.718281828459045 |
All three are float constants.
fn main() {
print(math.pi, math.tau, math.e)
const r = 2.0
print(math.pi * r * r)
}3.141592653589793 6.283185307179586 2.718281828459045
12.566370614359172Related
math
The math namespace: always in scope, one page for each group of functions, with the rules for overflow, NaN and infinity.
min, max, clamp, abs and signum
Choosing and limiting values: min, max and clamp for any ordered type, abs and signum for signed numbers, with the overflow and bad-range stops.