Calculate
Calculations and processing of numeric values.
These functions are part of the calc
module and not imported by default. In
addition to the functions listed below, the calc
module also defines the
constants pi
, e
, inf
, and nan
.
Functions
abs
Calculate the absolute value of a numeric value.acos
Calculate the arccosine of a number.asin
Calculate the arcsine of a number.atan
Calculate the arctangent of a number.atan2
Calculate the four-quadrant arctangent of a coordinate.binom
Calculate a binomial coefficient.ceil
Round a number up to the nearest integer.clamp
Clamp a number between a minimum and maximum value.cos
Calculate the cosine of an angle.cosh
Calculate the hyperbolic cosine of an angle.even
Determine whether an integer is even.fact
Calculate the factorial of a number.floor
Round a number down to the nearest integer.fract
Returns the fractional part of a number.gcd
Calculate the greatest common divisor of two integers.lcm
Calculate the least common multiple of two integers.log
Calculate the logarithm of a number.max
Determine the maximum of a sequence of values.min
Determine the minimum of a sequence of values.mod
Calculate the modulus of two numbers. (Deprecated)odd
Determine whether an integer is odd.perm
Calculate a permutation.pow
Raise a value to some exponent.quo
Calculate the quotient of two numbers.rem
Calculate the remainder of two numbers.round
Round a number to the nearest integer.sin
Calculate the sine of an angle.sinh
Calculate the hyperbolic sine of an angle.sqrt
Calculate the square root of a number.tan
Calculate the tangent of an angle.tanh
Calculate the hyperbolic tangent of an angle.trunc
Returns the integer part of a number.