ABS

Syntax

ABS (

Description

The absolute value of a number is its unsigned magnitude. For example,
ABS(-1) and ABS(1) both return 1. The required *number* argument can be any
valid numeric expression. If *number* is an uninitialized variable, zero is
returned.

WIth firmware 8.15 support for floating point has been added and is valid for SINGLE variables, in fact it's the one case where floating point is faster than integer.

Example

PRINT ABS ( -1 )

PRINT ABS ( 42 )

PRINT ABS ( N )

N = -69

PRINT ABS ( N )

The output would look like:

1

42

0

69

42

0

69

Differences from other BASICs

- none from Visual BASIC
- none from PBASIC

See also