abs(int)

From NWN Lexicon

Get the absolute value of a number.

int abs(
    int nValue
);

Contents

[edit] Parameters

nValue
Integer to return the absolute value of.

[edit] Description

Returns the absolute (non-negative, numeric distance from the number 0) value of nValue.

[edit] Version

1.22

[edit] Example

int nHigh = 12;
int nHighAbs = abs(nHigh);
//nHighAbs equals 12, the distance from 0
 
int nLow = -9;
int nLowAbs = abs(nLow);
//nLowAbs equals 9, the distance from 0

[edit] See Also

functions:  GetAngleBetweenLocations

 author: Charles Feduke, editor: Jeff Lindsey

Personal tools
Categories