Difference between revisions of "Max"

From King Arthur's Gold Wiki
Jump to: navigation, search
(Created page with "<onlyinclude> Returns the larger of the two given numbers. </onlyinclude> This method has two variants - one for ints, the other for floats. <syntaxhighlight lang="cpp"> float M...")
 
 
Line 2: Line 2:
 
Returns the larger of the two given numbers.
 
Returns the larger of the two given numbers.
 
</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">
float Max(float a, float b)
+
float Maths::Max(float a, float b)
int Max(int a, int b)
+
int Maths::Max(int a, int b)
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:Scripting]]
 
[[Category:Scripting]]
 
[[Category:Global Functions]]
 
[[Category:Global Functions]]

Latest revision as of 22:24, 6 September 2012

Returns the larger of the two given numbers.


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.

float Maths::Max(float a, float b)
int Maths::Max(int a, int b)