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 SGN function returns the sign of a number value.

Syntax

sign% = SGN(value)

Example(s)

Checking and changing negative values to positive ones.


n = -100
IF SGN(n) = -1 THEN n = ABS(n)
PRINT n 


 100

See Also