Difference between revisions of "SHIP:Sail:dtof"

From Serious Documentation
Jump to: navigation, search
(Created page with "__NOTOC__ {{SailFuncTableStart|}}<onlyinclude> |{{SailFunc|dtof}}||{{DataType|Integer}}||style="text-align:center;"|v5.1.0||Explicitly casts an {{DataType|Double}} to a {{Data...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
{{SailFuncTableStart|}}<onlyinclude>
 
{{SailFuncTableStart|}}<onlyinclude>
|{{SailFunc|dtof}}||{{DataType|Integer}}||style="text-align:center;"|v5.1.0||Explicitly casts an {{DataType|Double}} to a {{DataType|Float}} {{v5}}</onlyinclude>
+
|{{SailFunc|dtof}}||{{DataType|Integer}}||style="text-align:center;"|v5.1.0||Explicitly casts an {{DataType|Double}} to a {{DataType|Float}}</onlyinclude>
 
|}
 
|}
 
== See Also: ==
 
== See Also: ==
Line 26: Line 26:
 
== Detailed Description ==
 
== Detailed Description ==
  
The <code>{{SailFunc|dtof}}()</code> function explicitly casts the supplied {{DataType|Double}} to an {{DataType|Float}}.  You may want to use this in mathematical expressions around items so that the expression evaluation is moved into the floating point domain. For example:
+
The <code>{{SailFunc|dtof}}()</code> function explicitly casts the supplied {{DataType|Double}} to an {{DataType|Float}}.  You may want to use this in mathematical expressions around items where precision can be reduced.
  
  
Line 40: Line 40:
 
|<code>{{SailFunc|dtof}}(5);</code> || 5.0 ||
 
|<code>{{SailFunc|dtof}}(5);</code> || 5.0 ||
 
|}
 
|}
 +
 +
[[Category:Numeric Functions]]

Latest revision as of 17:02, 13 October 2016

Function Returns Introduced Description
dtof Integer v5.1.0 Explicitly casts an Double to a Float

See Also:

Prototype

Float dtof(Double n);

Parameters/Return Value

Parameter Data Type Description
n Double the number to cast
Return Float the floating point version of the supplied number

Detailed Description

The dtof() function explicitly casts the supplied Double to an Float. You may want to use this in mathematical expressions around items where precision can be reduced.


Examples

Example Result Notes
dtof(-5); -5.0
dtof(5); 5.0