Difference between revisions of "SHIP:Sail:abs"

From Serious Documentation
Jump to: navigation, search
Line 8: Line 8:
 
*[[SHIP:Sail:Functions|Sail Functions]]
 
*[[SHIP:Sail:Functions|Sail Functions]]
 
*[[SHIP:Sail:Functions|Sail Numeric Functions]]
 
*[[SHIP:Sail:Functions|Sail Numeric Functions]]
*{{SailFunc|abs}}, {{SailFunc|ceil}}, {{SailFunc|floor}}, {{SailFunc|ftoi}}, {{SailFunc|itof}}, {{SailFunc|max}}, {{SailFunc|min}}, {{SailFunc|round}}
+
*{{SailFunc|ceil}}, {{SailFunc|floor}}, {{SailFunc|ftoi}}, {{SailFunc|itof}}, {{SailFunc|max}}, {{SailFunc|min}}, {{SailFunc|round}}
 
== Prototype ==
 
== Prototype ==
 
<code>{{DataType|Integer}} {{SailFunc|abs}}({{DataType|Integer}} number);</code>
 
<code>{{DataType|Integer}} {{SailFunc|abs}}({{DataType|Integer}} number);</code>

Revision as of 08:20, 13 July 2014

Function Returns Introduced Description
abs Integer/Float 1 Gets the absolute value of a number

The Float form of this function was introduced in SHIP Version 5.0.

See Also:

Prototype

Integer abs(Integer number);

Float abs(Float number);

Parameters/Return Value

Parameter Data Type Description
number Integer/Float The number to find the absolute value of
Return Integer/Float the absolute value of the supplied 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