The following usual mathematical functions are available. They perform scalar operations, either on integers or real numbers. These operations are performed using a double precision for their floating-point implementation.
Function | Syntax | Remarks |
---|---|---|
Smallest value | min(a,b) | |
Largest value | max(a,b) | |
Absolute value | abs(a) | |
Square root | sqrt(a) | |
Exponential | exp(a) | |
Natural logarithm | log(a) | |
Common logarithm | log10(a) | |
Logistic function | logit(a) | |
Inverse of the logistic function | invlogit(a) | |
Probit function | probit(a) | Aliases: norminv, qnorm. |
Normal CDF | normcdf(a) | Alias: pnorm. |
Sine | sin(a) | |
Cosine | cos(a) | |
Tangent | tan(a) | |
Inverse Sine | asin(a) | |
Inverse Cosine | acos(a) | |
Inverse Tangent | atan(a) | |
Hyperbolic Sine | sinh(a) | |
Hyperbolic Cosine | cosh(a) | |
Hyperbolic Tangent | tanh(a) | |
Four quadrant inverse tangent | atan2(a,b) | |
Logarithm of gamma function | gammaln(a) | Alias: lgamma |
Downward rounding | floor(a) | |
Upward rounding | ceil(a) | |
Factorial | factorial(a) | |
Logarithm of factorial | factln(a) | |
Remainder after division | rem(a) |