Difference between revisions of "SHIP:Sail:max"

From Serious Documentation
Jump to: navigation, search
(Prototype)
(Parameters/Return Value)
Line 24: Line 24:
 
! scope="col" style="text-align:left" | Description
 
! scope="col" style="text-align:left" | Description
 
|-
 
|-
|n1||{{DataType|Integer}}||The first of a set of numbers to find the maximum of
+
|n1||{{DataType|Integer}}/{{DataType|Float}}||The first of a set of numbers to find the maximum of
 
|-
 
|-
|n2||{{DataType|Integer}}||The second of a set of numbers to find the maximum of
+
|n2||{{DataType|Integer}}/{{DataType|Float}}||The second of a set of numbers to find the maximum of
 
|-
 
|-
|n3||{{DataType|Integer}}||The third of a set of numbers to find the maximum of
+
|n3||{{DataType|Integer}}/{{DataType|Float}}||The third of a set of numbers to find the maximum of
 
|-
 
|-
 
! scope="col" style="text-align:left" | Return
 
! scope="col" style="text-align:left" | Return
! scope="col" style="text-align:left" | {{DataType|Integer}}
+
! scope="col" style="text-align:left" | {{DataType|Integer}}/{{DataType|Float}}
! scope="col" style="text-align:left" | the maximum of the supplied numbers.
+
! scope="col" style="text-align:left" | the maximum of the supplied numbers; if any parameter is a {{DataType|Float}}, the result will be a {{DataType|Float}}
 
|}
 
|}
  

Revision as of 05:27, 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