Livecode Wiki
Advertisement

Syntax

put the abs of <Operand>

You need: com.livecode.math

Absolute value operator.

Parameters

  • Operand: An expression that evaluates to a number.

Examples

use com.livecode.math
variable tVar as Number
put the abs of -3.9 into tVar -- tVar contains 3.9
put the abs of 5 into tVar -- tVar contains 5

The absolute value of Operand is the value of Operand if it is greater than or equal to 0, or the negation of the value of Operand if it is less than zero.

Advertisement