Description
The abs
function returns the absolute value of a number. The absolute value of a number is the numerical value without its sign.
Syntax
abs(number)
Arguments
Argument | Description |
---|---|
number |
The number whose absolute value is to be calculated. |
Return Type
The function returns the absolute value of the input number.
Examples
Description | Formula | Result |
---|---|---|
Positive Number |
abs(10) |
Returns 10 |
Negative Number |
abs(-5) |
Returns 5 |
Zero |
abs(0) |
Returns 0 |
Notes
- No Change for Positive Numbers: Positive numbers remain unchanged.
- Suitable for Mathematical Calculations: The function is often used to calculate differences or distances.
Comments
0 comments
Please sign in to leave a comment.