Difference between revisions of "SHIP:Sail:floor"

From Serious Documentation
Jump to: navigation, search
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
See Also:
 
*[[SHIP:Sail|SHIP Sail Home]]
 
*[[SHIP:Sail:Functions|SHIP Sail Function Home]]
 
*{{SailFunc|abs}}, {{SailFunc|ceil}}, {{SailFunc|floor}}, {{SailFunc|ftoi}}, {{SailFunc|itof}}, {{SailFunc|max}}, {{SailFunc|min}}, {{SailFunc|round}}
 
 
 
{{SailFuncTableStart|}}<onlyinclude>
 
{{SailFuncTableStart|}}<onlyinclude>
|{{SailFunc|floor}}||{{DataType|Integer}}||1||Gets the largest integer less than or equal to a number</onlyinclude>
+
|{{SailFunc|floor}}||{{DataType|Integer}}||style="text-align:center;"|v5.0||Gets the largest integer less than or equal to a number</onlyinclude>
 
|}
 
|}
 
+
== See Also ==
 +
*[[SHIP:Sail|Sail Home]]
 +
*[[SHIP:Sail:Functions|Sail Functions]]
 +
*[[SHIP:Sail:Numeric Functions|Sail Numeric Functions]]
 +
*{{SailFunc|abs}}, {{SailFunc|ceil}}, {{SailFunc|ftoi}}, {{SailFunc|itof}}, {{SailFunc|max}}, {{SailFunc|min}}, {{SailFunc|round}}
 
== Prototype ==
 
== Prototype ==
 
<code>{{DataType|Integer}} {{SailFunc|floor}}({{DataType|Float}} n);</code>
 
<code>{{DataType|Integer}} {{SailFunc|floor}}({{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
Line 18: Line 17:
 
! scope="col" style="text-align:left" | Description
 
! scope="col" style="text-align:left" | Description
 
|-
 
|-
|n||{{DataType|Integer}}/{{DataType|Float}}||the number to find the floor value of
+
|n||{{DataType|Float}}||the number to find the floor value of
 
|-
 
|-
 
! scope="col" style="text-align:left" | Return
 
! scope="col" style="text-align:left" | Return
Line 39: Line 38:
 
|<code>{{SailFunc|floor}}(5.2f);</code> || 5 ||
 
|<code>{{SailFunc|floor}}(5.2f);</code> || 5 ||
 
|}
 
|}
 +
 +
[[Category:Numeric Functions]]

Latest revision as of 17:20, 13 October 2016

Function Returns Introduced Description
floor Integer v5.0 Gets the largest integer less than or equal to a number

See Also

Prototype

Integer floor(Float n);

Parameters/Return Value

Parameter Data Type Description
n Float the number to find the floor value of
Return Integer the floor (lower) of the supplied number

Detailed Description

The floor() function returns the returns the largest integer less than or equal to a number. If you visualize a number line, floor() goes to the integer to the left.

Examples

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