PickBASIC / FlashBASIC

abs() function

.md

The abs() function returns the absolute (positive) portion of the integer number derived from the given numeric expression.

Syntax

abs(num.exp)

Parameter(s)

num.exp Expression resulting in an integer number.
Note: If the expression is nonnumeric, 0 is assumed.

Example(s)

x = -1
y = abs(x)
print y   ;* 1

Absolute value

print abs(-5)   ;* 5

See also