Difference between revisions of "SHIP:Sail:ceil"

From Serious Documentation
Jump to: navigation, search
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
{{SailFuncTableStart|}}<onlyinclude>
 
{{SailFuncTableStart|}}<onlyinclude>
|{{SailFunc|ceil}}||{{DataType|Integer}}||1||Gets the smallest integer greater than or equal to a number (v5)</onlyinclude>
+
|{{SailFunc|ceil}}||{{DataType|Integer}}||style="text-align:center;"|v5.0||Gets the smallest integer greater than or equal to a number</onlyinclude>
 
|}
 
|}
This function was introduced in SHIP Version 5.0.
 
 
== See Also: ==
 
== See Also: ==
*[[SHIP:Sail|SHIP Sail Home]]
+
*[[SHIP:Sail|Sail Home]]
*[[SHIP:Sail:Functions|SHIP Sail Function Home]]
+
*[[SHIP:Sail:Functions|Sail Functions]]
*{{SailFunc|abs}}, {{SailFunc|ceil}}, {{SailFunc|floor}}, {{SailFunc|ftoi}}, {{SailFunc|itof}}, {{SailFunc|max}}, {{SailFunc|min}}, {{SailFunc|round}}
+
*[[SHIP:Sail:Numeric Functions|Sail Numeric Functions]]
 +
*{{SailFunc|abs}}, {{SailFunc|floor}}, {{SailFunc|ftoi}}, {{SailFunc|itof}}, {{SailFunc|max}}, {{SailFunc|min}}, {{SailFunc|round}}
 
== Prototype ==
 
== Prototype ==
 
<code>{{DataType|Integer}} {{SailFunc|ceil}}({{DataType|Float}} n);</code>
 
<code>{{DataType|Integer}} {{SailFunc|ceil}}({{DataType|Float}} n);</code>
Line 38: Line 38:
 
|<code>{{SailFunc|ceil}}(5.2f);</code> || 6 ||
 
|<code>{{SailFunc|ceil}}(5.2f);</code> || 6 ||
 
|}
 
|}
 +
 +
[[Category:Numeric Functions]]

Latest revision as of 17:01, 13 October 2016

Function Returns Introduced Description
ceil Integer v5.0 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 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