Module functions

Source
Expand description

Built-in mathematical functions for expression evaluation.

This module provides the implementation of all built-in functions that can be used in expressions. These include common mathematical operations like trigonometric functions, logarithms, exponentials, and more. The functions handle special cases like division by zero and out-of-range inputs gracefully by returning appropriate values like NaN or infinity.

All functions use the libm crate for their implementations, which ensures compatibility with no_std environments. Depending on the selected floating-point precision (f32 or f64, controlled by the “f32” feature), different versions of the math functions are used.

Functions§

abs
acos
add
Adds two values.
asin
atan
atan2
ceil
comma
cos
cosh
div
Divides the first value by the second.
dummy
Dummy function that panics when called.
e
exp
floor
fmod
ln
log
log10
max
Returns the maximum of two values.
min
Returns the minimum of two values.
mul
Multiplies two values.
neg
pi
pow
Raises a value to a power.
sign
sin
sinh
sqrt
sub
Subtracts the second value from the first.
tan
tanh