Skip to content
Matěj Štágl edited this page Feb 5, 2019 · 3 revisions

abs

Returns the absolute value of a given value

Syntax:

abs(n)
Argument Description
double n The value to turn absolute

Returns: double

Description:

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.

Example:

double value;
value = abs(32);

This function sets value to 32.

Example 2:

double value;
value = abs(-5);

This function sets value to 5.

Back to number_functions

Clone this wiki locally