Math Absolute
The math::abs
function calculates the absolute value of a given number.
Syntax
math::abs(<number>)
Parameters
number
: The input number for which the absolute value is to be calculated.
Returns
- Number: The absolute value of the input number.
Example
math::abs(-42)
This function is useful for ensuring non-negative values in calculations or data processing.