Difference between revisions of "SHIP:Sail:abs"

From Serious Documentation
Jump to: navigation, search
(min)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
See Also:
+
{{SailFuncTableStart|}}<onlyinclude>
 +
|{{SailFunc|abs}}||{{DataType|Integer}}/{{DataType|Float}}||1||Gets the absolute value of a number</onlyinclude>
 +
|}
 +
== See Also: ==
 
*[[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|min}}, {{SailFunc|max}}, {{SailFunc|round}}, {{SailFunc|ceil}}, {{SailFunc|floor}}, {{SailFunc|itof}}, {{SailFunc|ftoi}}
+
*{{SailFunc|abs}}, {{SailFunc|ceil}}, {{SailFunc|floor}}, {{SailFunc|ftoi}}, {{SailFunc|itof}}, {{SailFunc|max}}, {{SailFunc|min}}, {{SailFunc|round}}
== min ==
 
{{SailFuncTableStart|}}<onlyinclude>
 
|{{SailFunc|abs}}||{{DataType|Integer}}/{{DataType|Float}}||2+||Gets the absolute value of a number</onlyinclude>
 
|}
 
 
 
 
== Prototype ==
 
== Prototype ==
 
<code>{{DataType|Integer}} {{SailFunc|abs}}({{DataType|Integer}} number);</code>
 
<code>{{DataType|Integer}} {{SailFunc|abs}}({{DataType|Integer}} number);</code>
Line 14: Line 12:
 
<code>{{DataType|Float}} {{SailFunc|abs}}({{DataType|Float}} number);</code>
 
<code>{{DataType|Float}} {{SailFunc|abs}}({{DataType|Float}} number);</code>
  
 
+
== Parameters/Return Value ==
=== Parameters/Return Value ===
 
 
{| class="wikitable" style="margin: 1em 1em;"  
 
{| class="wikitable" style="margin: 1em 1em;"  
 
! scope="col" style="text-align:left" | Parameter
 
! scope="col" style="text-align:left" | Parameter
Line 29: Line 26:
 
== Detailed Description ==
 
== Detailed Description ==
 
The <code>{{SailFunc|abs}}(number)</code> function returns the absolute value of the specified number.
 
The <code>{{SailFunc|abs}}(number)</code> function returns the absolute value of the specified number.
 
 
== Examples ==
 
== Examples ==
 
{| class="wikitable" style="margin: 1em 1em;"  
 
{| class="wikitable" style="margin: 1em 1em;"  

Revision as of 06:15, 22 June 2014

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

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