abs()
Learn how to use the abs() function to calculate the absolute value of an input.
Calculates the absolute value of the input.
Syntax
abs(x)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| x | int, real, or timespan | ✔️ | The value to make absolute. |
Returns
Absolute value of x.
Example
print abs(-5)
Output
| print_0 |
|---|
| 5 |
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.