Difference between revisions of "SHIP:Sail:round"

From Serious Documentation
Jump to: navigation, search
Line 42: Line 42:
 
|<code>{{SailFunc|round}}(5.5f);</code> || 6 ||
 
|<code>{{SailFunc|round}}(5.5f);</code> || 6 ||
 
|}
 
|}
 +
 +
[[Categories: Numeric Functions]]

Revision as of 14:44, 4 October 2016

Function Returns Introduced Description
round Integer v5.0 Gets the nearest integer to a number Badge SHIPv5.gif

See Also:

Prototype

Integer round(Float n);

Parameters/Return Value

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

Detailed Description

The round() function returns the nearest integer to a number.

Examples

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

Categories: Numeric Functions