NWNWiki
NWNWiki
3,718
pages
Nik99 (talk | contribs)
No edit summary
 
Nik99 (talk | contribs)
No edit summary
Line 37: Line 37:
   
 
====See Also====
 
====See Also====
  +
Functions: [[abs]] | [[GetAngleBetweenLocations]]
   
  +
[[Category:NWScript functions]]
{| class="seealso"
 
  +
[[Category:Math functions]]
| width="1px" align="right" valign="top" | <font color="gray">functions: </font>
 
|
 
[abs]
 
|-
 
| width="1px" align="right" valign="top" | <font color="gray">categories: </font>
 
|
 
[category:Mathfunctions]
 
|}
 
   
 
Converted from NWNLexicon
<br />
 
   
 
<font color="gray"> author: Charles Feduke, editor: Lilac Soul</font>
 
Converted from NWNLexicon
 
<font color="gray"> author: Charles Feduke, editor: Lilac Soul</font
 

Revision as of 15:43, 14 September 2006

fabs(float)

Gets the absolute value of a number.

float fabs(
    float fValue
);

Parameters

fValue

Float to retrieve the absolute value of.

Description

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



Remarks

Useful when subtracting two numbers, without first having to find find out which is higher, when all you're interested in is the difference between the two.

Version

1.61

Example

void main()
{
    //Both fFloat1 and fFloat2 will be 1.0
    float fFloat1=fabs(3. - 2.);
    float fFloat2=fabs(2. - 3.);
}

See Also

Functions: abs | GetAngleBetweenLocations

Converted from NWNLexicon

author: Charles Feduke, editor: Lilac Soul