Difference between revisions of "SHIP:Sail:ltoi"

From Serious Documentation
Jump to: navigation, search
(Created page with "__NOTOC__ {{SailFuncTableStart|}}<onlyinclude> |{{SailFunc|ltoi}}||{{DataType|Integer}}||style="text-align:center;"|v5.1.0||Explicitly casts an {{DataType|Long}} to an {{DataT...")
 
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
{{SailFuncTableStart|}}<onlyinclude>
 
{{SailFuncTableStart|}}<onlyinclude>
|{{SailFunc|ltoi}}||{{DataType|Integer}}||style="text-align:center;"|v5.1.0||Explicitly casts an {{DataType|Long}} to an {{DataType|Integer}} {{v5}}</onlyinclude>
+
|{{SailFunc|ltoi}}||{{DataType|Integer}}||style="text-align:center;"|v5.1.0||Explicitly casts a {{DataType|Long}} to an {{DataType|Integer}}</onlyinclude>
 
|}
 
|}
 
== See Also: ==
 
== See Also: ==
Line 38: Line 38:
 
|<code>{{SailFunc|ltoi}}(5);</code> || 5 ||
 
|<code>{{SailFunc|ltoi}}(5);</code> || 5 ||
 
|}
 
|}
 +
 +
[[Category:Numeric Functions]]

Latest revision as of 17:27, 3 November 2016

Function Returns Introduced Description
ltoi Integer v5.1.0 Explicitly casts a Long to an Integer

See Also:

Prototype

Integer ltoi(Long n);

Parameters/Return Value

Parameter Data Type Description
n Long the number to cast
Return Integer the integer version of the supplied number

Detailed Description

The ltoi() function explicitly casts the supplied Long to an Integer. You may want to use this in mathematical expressions around items to reduce precision and memory usage.

Examples

Example Result Notes
ltoi(-5); -5
ltoi(5); 5