Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

math Module

This one is a brief module because these math functions are common in basically every programming language, so I’ll keep the explanations short and straight to the point.

math.mini(a: i64, b: i64)

Returns the minimum of two i64 values

Returns

  • i64: The lower value between parameters a and b

math.maxi(a: i64, b: i64)

Returns the maximum of two i64 values

Returns

  • i64: The higher value between parameters a and b

math.minf(a: f64, b: f64)

Returns the minimum of two f64 values

Returns

  • f64: The lower value between parameters a and b

math.maxf(a: f64, b: f64)

Returns the minimum of two f64 values

Returns

  • f64: The higher value between parameters a and b

math.randi(min_v: i64, max_v: i64)

Returns a random integer between a minimum and maximum value, inclusive

Returns

  • i64: A random integer between your provided minimum and maximum

math.randf(min_v: f64, max_v: f64)

Returns a random number between a minimum and maximum value, inclusive

Returns

  • f64: A random number between your provided minimum and maximum