SHIP:Sail:dtol

From Serious Documentation
Jump to: navigation, search
Function Returns Introduced Description
dtol Long v5.1.0 Casts a Double to a Long

See Also:

Prototype

Long dtol(Double n);

Parameters/Return Value

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

Detailed Description

The dtol() function returns the returns the integer portion of the supplied 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 dtol(round(x)).

Examples

Example Result Notes
dtol(-5.1); -5
dtol(5.2); 5