Difference between revisions of "SHIP:Sail:ceil"

From Serious Documentation
Jump to: navigation, search
Line 3: Line 3:
 
|{{SailFunc|ceil}}||{{DataType|Integer}}||1||Gets the smallest integer greater than or equal to a number</onlyinclude>
 
|{{SailFunc|ceil}}||{{DataType|Integer}}||1||Gets the smallest integer greater than or equal to a number</onlyinclude>
 
|}
 
|}
=== See Also: ===
+
== 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]]
Line 10: Line 10:
 
<code>{{DataType|Integer}} {{SailFunc|ceil}}({{DataType|Float}} n);</code>
 
<code>{{DataType|Integer}} {{SailFunc|ceil}}({{DataType|Float}} n);</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

Revision as of 06:13, 22 June 2014

Function Returns Introduced Description
ceil Integer 1 Gets the smallest integer greater than or equal to a number

See Also:

Prototype

Integer ceil(Float n);

Parameters/Return Value

Parameter Data Type Description
n Integer/Float the number to find the ceiling value of
Return Integer the ceiling of the supplied number

Detailed Description

The ceil() function returns the returns the smallest integer greater than or equal to a number. If you visualize a number line, ceil() goes to the integer to the right.

Examples

Example Result Notes
ceil(-5.1f); -5
ceil(5.2f); 6