Difference between revisions of "SHIP:Sail:max"

From Serious Documentation
Jump to: navigation, search
(Created page with "__NOTOC__ See Also: *SHIP Sail Home *SHIP Sail Function Home *abs(), min() == max == Gets the maximu...")
 
(Examples)
Line 35: Line 35:
  
 
== Examples ==
 
== Examples ==
 +
{| class="wikitable" style="margin: 1em 1em;"
 +
! scope="col" style="text-align:left" | Example
 +
! scope="col" style="text-align:left" | Result
 +
! scope="col" style="text-align:left" | Notes
 +
|-
 +
|<code>max(-5,-6);</code> || -5 ||
 +
|-
 +
|<code>max(-5, 2, 12);</code> || 12 ||
 +
|-
 +
|<code>max(0, 6, -5);</code> || 6 ||
 +
|}

Revision as of 17:27, 6 December 2012

See Also:

max

Gets the maximum value of two or more numbers.

Prototype

Integer max(Integer n1, Integer n2);

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

Parameters/Return Value

Parameter Data Type Description
n1 Integer The first of a set of numbers to find the maximum of
n2 Integer The second of a set of numbers to find the maximum of
n3 Integer The third of a set of numbers to find the maximum of
Return Integer the maximum of the supplied numbers.

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