BB___ABS

=ABS= toc

Description
> This function returns the absolute value of the given number or expression. > For negative values it will return the positive value.

Syntax

 * 1) ABS(Number)

Hints

 * 1) Most mathematical operations in Just BASIC can be performed on Literal Numbers, Numeric Variables, or Numeric Expressions that consist of Literal Numbers, Numeric Variables, or both.

Example
code format="lb" Print ABS(2) Print ABS(3.5) Print ABS(-0.2) Print ABS(2*1.5) End code Produces: 2 3.5 0.2 3.0

Useful Functions
code format="lb" Function SGN(number) ' This function returns the sign of a number: '   -1 ... negative number '    0 ... zero '    1 ... positive number

If number <> 0 Then SGN = number / ABS(number) End Function code