QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

The ABS function returns the unsigned numerical value of a variable or literal value.

Syntax

positive = ABS(numericalValue)

Description

Example(s)

Finding the absolute value of positive and negative numerical values.


a = -6
b = -7
c = 8
IF a < 0 THEN a = ABS(a)
b = ABS(b)
c = ABS(c)
PRINT a, b, c 


 6        7        8

See Also