Community QBasic

Rebooting the QBasic we all know and love!


Project maintained by Cory Smith

ABS

To return the absolute value of a numeric expression.

Syntax

ABS(numeric_expression)

Comments

numeric_expression is any numeric expression.

ABS always returns a positive value, regardless of whether the result of the expression is positive or negative.

ABS returns a value of the same type as numeric_expression (INTEGER, LONG, DOUBLE and so on).

Example

PRINT ABS(7*(-5))
 35

Prints 35 as the result of the action.

See Also