Please enable JavaScript to view this site.

 

int = Abs(nNumber)

 

This macro function takes an integer as parameter and returns the absolute value of nNumber. The absolute value of a number is the same number if that number is positive, or its negative if the number is negative.

Abs(20// 20
Abs(-30// 30
Abs(0// 0

Note that the following is always true :

nNumber ≡ Sign(nNumber) * Abs(nNumber)

See also: Sign.

 


Topic 174325, last updated on 18-Apr-2020