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.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.floor
Round a number down to the nearest integer.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.odd
Determine whether an integer is odd.pow
Raise a value to some exponent.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.