Basic30 Language Reference
abs Function

Return the absolute value of x .

Function abs(x As <any>) As <any>

Notes:

Abs will work on any numerical data type, Byte, uByte, Integer, uInteger, Long, uLong, Single.

Requirements

  1. This function requires the link time library "libm.a" when used with a Single data type.  It is a free download from the Microchip website.

Examples

Dim a,x as Single

x=abs(a)