Difference between revisions of "SHIP:Sail:max"

From Serious Documentation
Jump to: navigation, search
Line 3: Line 3:
 
*[[SHIP:Sail|SHIP Sail Home]]
 
*[[SHIP:Sail|SHIP Sail Home]]
 
*[[SHIP:Sail:Functions|SHIP Sail Function Home]]
 
*[[SHIP:Sail:Functions|SHIP Sail Function Home]]
*[[SHIP:Sail:abs|abs()]], [[SHIP:Sail:min|min()]], [[SHIP:Sail:round|round()]], [[SHIP:Sail:ceil|ceil()]], [[SHIP:Sail:floor|floor()]], [[SHIP:Sail:ftoi|ftoi()]], [[SHIP:Sail:itof|itof()]]
+
* {{SailFunc|abs}}, {{SailFunc|min}}, {{SailFunc|round}}, {{SailFunc|ceil}}, {{SailFunc|floor}}, {{SailFunc|itof}}, {{SailFunc|ftoi}}
  
 
== max ==
 
== max ==
Line 11: Line 11:
  
 
== Prototype ==
 
== Prototype ==
<code>{{DataType|Integer}} max({{DataType|Integer}} n1, {{DataType|Integer}} n2);</code>
+
<code>{{DataType|Integer}} {{SailFunc|max}}({{DataType|Integer}} n1, {{DataType|Integer}} n2);</code>
  
<code>{{DataType|Integer}} max({{DataType|Integer}} n1, {{DataType|Integer}} n2, {{DataType|Integer}} n3);</code>
+
<code>{{DataType|Integer}} {{SailFunc|max}}({{DataType|Integer}} n1, {{DataType|Integer}} n2, {{DataType|Integer}} n3);</code>
  
<code>{{DataType|Float}} max({{DataType|Integer}}/{{DataType|Float}} n1, {{DataType|Integer}}/{{DataType|Float}} n2);</code>
+
<code>{{DataType|Float}} {{SailFunc|max}}({{DataType|Integer}}/{{DataType|Float}} n1, {{DataType|Integer}}/{{DataType|Float}} n2);</code>
  
<code>{{DataType|Float}} max({{DataType|Integer}}/{{DataType|Float}} n1, {{DataType|Integer}}/{{DataType|Float}} n2, {{DataType|Integer}}/{{DataType|Float}} n3);</code>
+
<code>{{DataType|Float}} {{SailFunc|max}}({{DataType|Integer}}/{{DataType|Float}} n1, {{DataType|Integer}}/{{DataType|Float}} n2, {{DataType|Integer}}/{{DataType|Float}} n3);</code>
 
=== Parameters/Return Value ===
 
=== Parameters/Return Value ===
 
{| class="wikitable" style="margin: 1em 1em;"  
 
{| class="wikitable" style="margin: 1em 1em;"  
Line 37: Line 37:
 
== Detailed Description ==
 
== Detailed Description ==
  
The <code>max()</code> function returns the maximum value of the set of specified numbers.
+
The <code>{{SailFunc|max}}()</code> function returns the maximum value of the set of specified numbers.
  
 
== Examples ==
 
== Examples ==
Line 45: Line 45:
 
! scope="col" style="text-align:left" | Notes
 
! scope="col" style="text-align:left" | Notes
 
|-
 
|-
|<code>max(-5,-6);</code> || -5 ||
+
|<code>{{SailFunc|max}}(-5,-6);</code> || -5 ||
 
|-
 
|-
|<code>max(-5, 2, 12);</code> || 12 ||
+
|<code>{{SailFunc|max}}(-5, 2, 12);</code> || 12 ||
 
|-
 
|-
|<code>max(0, 6, -5);</code> || 6 ||
+
|<code>{{SailFunc|max}}(0, 6, -5);</code> || 6 ||
 
|}
 
|}

Revision as of 05:55, 22 June 2014

See Also:

max

Function Returns Introduced Description
max Integer,Float 2+ Gets the maximum value of two or more numbers

Prototype

Integer max(Integer n1, Integer n2);

Integer max(Integer n1, Integer n2, Integer n3);

Float max(Integer/Float n1, Integer/Float n2);

Float max(Integer/Float n1, Integer/Float n2, Integer/Float n3);

Parameters/Return Value

Parameter Data Type Description
n1 Integer/Float The first of a set of numbers to find the maximum of
n2 Integer/Float The second of a set of numbers to find the maximum of
n3 Integer/Float The third of a set of numbers to find the maximum of
Return Integer/Float the maximum of the supplied numbers; if any parameter is a Float, the result will be a Float

Detailed Description

The max() function returns the maximum value of the set of specified numbers.

Examples

Example Result Notes
max(-5,-6); -5
max(-5, 2, 12); 12
max(0, 6, -5); 6