SHIP:Sail:dtoi

From Serious Documentation
Revision as of 10:31, 29 September 2016 by CarltonHeyer (talk | contribs) (Created page with "__NOTOC__ {{SailFuncTableStart|}}<onlyinclude> |{{SailFunc|dtoi}}||{{DataType|Integer}}||style="text-align:center;"|v5.0||Casts a {{DataType|Double}} to an {{DataType|Integer}...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function Returns Introduced Description
dtoi Integer v5.0 Casts a Double to an Integer Badge SHIPv5.gif

See Also:

Prototype

Integer ftoi(Double n);

Parameters/Return Value

Parameter Data Type Description
n Double the number to find the ceiling value of
Return Double the integer portion of the supplied number

Detailed Description

The dtoi() function returns the returns the integer portion of the supplied double precision floating point number. Note this is a truncating conversion (as in Java and C), not a rounding conversion. Often, you'll want to use rounding as well, for example dtoi(round(x)).

Examples

Example Result Notes
dtoi(-5.1d); -5
dtoi(5.2d); 5