math
Mathematics, trigonometry, combinatorics, and statistics.
Quick start
use math
say math.sqrt 81
say math.factorial 5
say math.clamp 120 0 100
say math.piAPI reference
math.piPi.
math.eEuler number.
math.tauTau (2*pi).
math.infPositive infinity.
math.sqrt numberNumeric math helper.
math.cbrt numberNumeric math helper.
math.abs numberNumeric math helper.
math.floor numberNumeric math helper.
math.ceil numberNumeric math helper.
math.round numberNumeric math helper.
math.trunc numberNumeric math helper.
math.sin numberNumeric math helper.
math.cos numberNumeric math helper.
math.tan numberNumeric math helper.
math.asin numberNumeric math helper.
math.acos numberNumeric math helper.
math.atan numberNumeric math helper.
math.sinh numberNumeric math helper.
math.cosh numberNumeric math helper.
math.tanh numberNumeric math helper.
math.asinh numberNumeric math helper.
math.acosh numberNumeric math helper.
math.atanh numberNumeric math helper.
math.exp numberNumeric math helper.
math.exp2 numberNumeric math helper.
math.expm1 numberNumeric math helper.
math.log numberNumeric math helper.
math.log10 numberNumeric math helper.
math.log2 numberNumeric math helper.
math.log1p numberNumeric math helper.
math.degrees numberNumeric math helper.
math.radians numberNumeric math helper.
math.gamma numberNumeric math helper.
math.lgamma numberNumeric math helper.
math.erf numberNumeric math helper.
math.erfc numberNumeric math helper.
math.atan2 a bTwo-number math helper.
math.pow a bTwo-number math helper.
math.fmod a bTwo-number math helper.
math.remainder a bTwo-number math helper.
math.copysign a bTwo-number math helper.
math.nextafter a bTwo-number math helper.
math.hypot number number...Euclidean norm for two or more values.
math.min number number...Minimum of two or more values.
math.max number number...Maximum of two or more values.
math.clamp value min maxClamp a number into a range.
math.lerp a b tLinear interpolation.
math.map_range value in_min in_max out_min out_maxMap a value between ranges.
math.sign numberReturn -1, 0, or 1.
math.isfinite numberCheck whether a number is finite.
math.isinf numberCheck whether a number is infinite.
math.isnan numberCheck whether a number is NaN.
math.gcd int int...Greatest common divisor.
math.lcm int int...Least common multiple.
math.factorial intFactorial for a non-negative Int.
math.comb n kNumber of combinations.
math.perm n kNumber of permutations.
math.sum listSum numeric List values.
math.mean listMean of numeric List values.
math.median listMedian of numeric List values.
math.variance listPopulation variance helper.
math.stddev listPopulation standard deviation helper.