Difference between revisions of "SHIP:Sail:abs"

From Serious Documentation
Jump to: navigation, search
(Detailed Description)
Line 10: Line 10:
  
 
== Prototype ==
 
== Prototype ==
<code>{{DataType|Integer}} abs({{DataType|Integer}} number);</code>
+
<code>{{DataType|Integer}} {{SailFunc|abs}}({{DataType|Integer}} number);</code>
  
<code>{{DataType|Float}} abs({{DataType|Float}} number);</code>
+
<code>{{DataType|Float}} {{SailFunc|abs}}({{DataType|Float}} number);</code>
  
  
Line 36: Line 36:
 
! scope="col" style="text-align:left" | Notes
 
! scope="col" style="text-align:left" | Notes
 
|-
 
|-
|<code>abs(-5);</code> || 5 ||
+
|<code>{{SailFunc|abs}}(-5);</code> || 5 ||
 
|-
 
|-
|<code>abs(0);</code> || 0 ||
+
|<code>{{SailFunc|abs}}(0);</code> || 0 ||
 
|-
 
|-
|<code>abs(6);</code> || 6 ||
+
|<code>{{SailFunc|abs}}(6);</code> || 6 ||
 
|}
 
|}

Revision as of 05:50, 22 June 2014

See Also:

min

Function Returns Introduced Description
min Integer/Float 2+ Gets the absolute value of a number

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