Extends Lua 5.2 math.
local math = require('__stdlib__/stdlib/utils/math')
Math.round(x) | Round a number. |
Math.sum(...) | Calculates the sum of a sequence of values. |
Math.arithmetic_mean(x) | Calculates the arithmetic mean of a set of values. |
Math.geometric_mean(x) | Calculates the geometric mean of a set of values. |
Math.harmonic_mean(...) | Calculates the harmonic mean of a set of values. |
Math.quadratic_mean(...) | Calculates the quadratic mean of a set of values. |
Math.generalized_mean(p, ...) | Calculates the generalized mean (to a specified power) of a set of values. |
Math.weighted_mean(x, w) | Calculates the weighted mean of a set of values. |
Math.midrange_mean(x) | Calculates the midrange mean of a set of values. |
Math.energetic_mean(x) | Calculates the energetic mean of a set of values. |
Math.clamp(x[, min=0][, max=1]) | Returns the number x clamped between the numbers min and max. |
Math.lerp(a, b, amount) | Linear interpolation or 2 numbers. |
Math.smooth(a, b, amount) | Smooth. |
Math.approximately(a, b) | Approximately the same |
Math.is_number(x) | Is x a number. |
Math.is_integer(x) | Is x an integer. |
Math.is_unsigned(x) | Is x unsigned. |
Round a number.
Parameters:
Calculates the sum of a sequence of values.
Parameters:
Calculates the arithmetic mean of a set of values.
Parameters:
Calculates the geometric mean of a set of values.
Parameters:
Calculates the harmonic mean of a set of values.
Parameters:
Calculates the quadratic mean of a set of values.
Parameters:
Calculates the generalized mean (to a specified power) of a set of values.
Parameters:
Calculates the weighted mean of a set of values.
Parameters: Returns:
Calculates the midrange mean of a set of values.
Parameters:
Calculates the energetic mean of a set of values.
Parameters:
Returns the number x clamped between the numbers min and max.
Parameters: Returns: