abs

Returns absolute value of the specified number.

Syntax

abs(x)

Parameters

Parameter

Type

Description

x

number

Numeric value

Return

Returns absolute value of x.

Examples

Python

# this script tests abs function
x =  - 2
ax = abs(x)
# ax is equal to 2

NexScript

% this script tests abs function
x = -2
ax = abs(x)
% ax is equal to 2