Difference between revisions of "Round"
From King Arthur's Gold Wiki
Shadlington (Talk | contribs) (Created page with "<onlyinclude> Rounds the given float to the nearest whole number, as an int. </onlyinclude> <syntaxhighlight lang="cpp"> int Round(float x) </syntaxhighlight> [[Category:Scripti...") |
Shadlington (Talk | contribs) |
||
Line 2: | Line 2: | ||
Rounds the given float to the nearest whole number, as an int. | Rounds the given float to the nearest whole number, as an int. | ||
</onlyinclude> | </onlyinclude> | ||
+ | |||
+ | This method is part of the Maths namespace so you need to prefix calls to it with 'Maths::'. | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
− | int Round(float x) | + | int Maths::Round(float x) |
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Scripting]] | [[Category:Scripting]] | ||
[[Category:Global Functions]] | [[Category:Global Functions]] |
Latest revision as of 22:25, 6 September 2012
Rounds the given float to the nearest whole number, as an int.
This method is part of the Maths namespace so you need to prefix calls to it with 'Maths::'.
int Maths::Round(float x)