SourcePoint AMD Help

Table of Contents

abs

Return the absolute value of an expression.

Syntax

[result =] abs(expr)

Where:

result

specifies a debug object to which the function return value is assigned. If result is not specified, the return value is displayed on the next line of the screen.

expr

specifies a number or an expression that evaluates to an integer or real number.

Discussion

The abs function returns the absolute value of an expression. ย 

Note: ย Values returned by this function are in real8 or 64-bit floating point precision. These values are displayed in the Command window rounded to 6 decimal digits. However, assignments and comparisons are performed on the full 64-bit value.

Example 1

To take the absolute value of a number and display it on the Command line:

Command input:

define int4 myVar = -23

abs(myVar)

Result:

00000023H

Example 2

To take the absolute value of a real number and assign it to a debug variable:

Command input:

define real8 var1 = -1.23

define real8 var2 = abs(var1)

var2

Result:

1.23

ย 

ย