-
-
Notifications
You must be signed in to change notification settings - Fork 18
abs
Matěj Štágl edited this page Feb 5, 2019
·
3 revisions
Returns the absolute value of a given value
abs(n)
Argument | Description |
---|---|
double n |
The value to turn absolute |
Returns: double
This function returns the absolute value of n
. If n
is a positive number, it will remain the same, but if it's negative, the function returns n
multiplied by -1 to make it positive.
double value;
value = abs(32);
This function sets value
to 32.
double value;
value = abs(-5);
This function sets value
to 5.
Back to number_functions