Method

Abs


Description

Returns the absolute value of a number.

Usage

result = Abs(value)

Part

Type

Description

result

Double

The absolute value of value.

value

Double

The number to convert to an absolute value.

Notes

The Abs function returns the positive equivalent of the value specified.

Sample code

These examples use the Abs function to return the absolute values of the numbers specified.

Var d As Double
d = Abs(23.9)  // returns 23.9
d = Abs(-23.9) // returns 23.9

Compatibility

All project types on all supported operating systems.

See also

Sign function