Differences

This shows you the differences between two versions of the page.


Previous revision
abs [2026/09/14 09:31] (current) – [Examples] jjflash
Line 1: Line 1:
 +~~NOTOC~~ 
  
 +====== ABS ======
 +
 +The ''ABS()'' function returns the absolute value of the passed numeric parameter.
 +
 +===== Function Header =====
 +
 +<code xcbasic>
 +DECLARE FUNCTION ABS AS BYTE (num AS BYTE) SHARED STATIC INLINE
 +DECLARE FUNCTION ABS AS INT (num AS INT) OVERLOAD SHARED STATIC INLINE
 +DECLARE FUNCTION ABS AS WORD (num AS WORD) OVERLOAD SHARED STATIC INLINE
 +DECLARE FUNCTION ABS AS LONG (num AS LONG) OVERLOAD SHARED STATIC INLINE
 +DECLARE FUNCTION ABS AS FLOAT (num AS FLOAT) OVERLOAD SHARED STATIC INLINE
 +</code>
 +===== Examples =====
 +
 +<code xcbasic>
 +PRINT ABS(-1) : REM will print 1
 +PRINT ABS(1) : REM will print 1
 +n = -5400
 +PRINT ABS(n) : REM will print 5400
 +</code>