Difference between revisions of "Abs"
From King Arthur's Gold Wiki
Shadlington (Talk | contribs) (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 ...") |
Shadlington (Talk | contribs) |
||
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 22: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)