Difference between revisions of "SHIP:Sail:abs"

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]]
*{{SailFunc|abs}}, {{SailFunc|min}}, {{SailFunc|max}}, {{SailFunc|round}}, {{SailFunc|ceil}}, {{SailFunc|floor}}, {{SailFunc|itof}}, {{SailFunc|ftoi}}
+
*{{SailFunc|min}}, {{SailFunc|max}}, {{SailFunc|round}}, {{SailFunc|ceil}}, {{SailFunc|floor}}, {{SailFunc|itof}}, {{SailFunc|ftoi}}
 
== min ==
 
== min ==
 
{{SailFuncTableStart|}}<onlyinclude>
 
{{SailFuncTableStart|}}<onlyinclude>

Revision as of 05:39, 22 June 2014

See Also:

min

Function Returns Introduced Description
min Integer/Float 2+ Gets the minimum value of two or more numbers

Prototype

Integer min(Integer n1, Integer n2);

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

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

Float min(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 minimum of
n2 Integer/Float The second of a set of numbers to find the minimum of
n3 Integer/Float The third of a set of numbers to find the minimum of
Return Integer/Float the minimum of the supplied numbers; if any parameter is a Float, the result will be a Float

Detailed Description

The min() function returns the minimum value of the set of specified numbers.

Examples

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


abs

Gets the absolute value of a number.

Prototype

Integer abs(Integer number);

Parameters/Return Value

Parameter Data Type Description
number Integer The number to take the absolute value of
Return Integer the absolute value of "number"

Detailed Description

The abs(number) function returns the absolute value of the specified number.

Examples

Example Result Notes
abs(-5); 5
abs(0); 0
abs(6); 6