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...")
 
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.
  
  

Revision as of 10:48, 29 September 2016

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

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