> For AI agents: the complete documentation index is available at https://massaman.dev/llms.txt, the full documentation bundle is available at https://massaman.dev/llms-full.txt.

# Math


[clampClamps a number within a specified range.](/reference/math/clamp)[inRangeChecks if a value is within a specified range.](/reference/math/inRange)[meanCalculates the average of an array of numbers.](/reference/math/mean)[meanByCalculates the average of an array by applying the getValue function to each element.](/reference/math/meanBy)[medianCalculates the median of an array of numbers.](/reference/math/median)[medianByCalculates the median of an array by applying the getValue function to each element.](/reference/math/medianBy)[percentileCalculates the value at the given percentile of an array of numbers.](/reference/math/percentile)[randomGenerates a random number within a specified range.](/reference/math/random)[randomIntGenerates a random integer within a specified range.](/reference/math/randomInt)[rangeCreates an array of numbers within a specified range and step.](/reference/math/range)[rangeRightCreates an array of numbers in reverse order within a specified range and step.](/reference/math/rangeRight)[roundRounds a number to a specified number of decimal places.](/reference/math/round)[sumReturns the sum of all elements in an array of numbers.](/reference/math/sum)[sumByCalculates the sum of array elements using a transformation function.](/reference/math/sumBy)