Jump to content

Abs()

From OpenBOR

Accepts a numeric value and returns its absolute value - its non-negative magnitude without regard to sign. Integer inputs return an integer, while decimal inputs return a decimal.

Whole

int input = -5;

int result = abs(input);

// result = 5

Decimal

float input = -3.8;

float result = abs(input);

// result = 3.8