Difference between revisions of "Abs"

From King Arthur's Gold Wiki
Jump to: navigation, search
(Created page with "<onlyinclude> Returns the absolute value of the given number. </onlyinclude> This method has two variants - one for ints, the other for floats. <syntaxhighlight lang="cpp"> int ...")
 
 
Line 2: Line 2:
 
Returns the absolute value of the given number.
 
Returns the absolute value of the given number.
 
</onlyinclude>
 
</onlyinclude>
 +
 +
This method is part of the Maths namespace so you need to prefix calls to it with 'Maths::'.
  
 
This method has two variants - one for ints, the other for floats.
 
This method has two variants - one for ints, the other for floats.
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
int Abs(int v)
+
int Maths::Abs(int v)
float Abs(float v)
+
float Maths::Abs(float v)
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:Scripting]]
 
[[Category:Scripting]]
 
[[Category:Global Functions]]
 
[[Category:Global Functions]]

Latest revision as of 23:25, 6 September 2012

Returns the absolute value of the given number.


This method is part of the Maths namespace so you need to prefix calls to it with 'Maths::'.

This method has two variants - one for ints, the other for floats.

int Maths::Abs(int v)
float Maths::Abs(float v)