Difference between revisions of "SHIP:Data Types:Double"

From Serious Documentation
Jump to: navigation, search
(Created page with "== See Also == *'''Node Home''' *'''All Data Types''' == {{DataType|Double}} == <onlyinclude>Double Data Types are available in SHIP_Versio...")
 
Line 3: Line 3:
 
*'''[[SHIP:Data_Types|All Data Types]]'''
 
*'''[[SHIP:Data_Types|All Data Types]]'''
 
== {{DataType|Double}} ==
 
== {{DataType|Double}} ==
<onlyinclude>Double Data Types are available in [[SHIP_Version_5|SHIPv5]] and onwards, and are [https://en.wikipedia.org/wiki/Double-precision_floating-point_format] floating point values.
+
<onlyinclude>Double Data Types are available in [[SHIP_Version_5|SHIPv5]] and onwards, and are [https://en.wikipedia.org/wiki/Double-precision_floating-point_format double precision IEEE754] floating point values.
 
{{DataTypeTableStart|}}
 
{{DataTypeTableStart|}}
|{{DataType|Double}}||A [https://en.wikipedia.org/wiki/Double-precision_floating-point_format] 64-bit floating point value.{{v5}}
+
|{{DataType|Double}}||A [https://en.wikipedia.org/wiki/Double-precision_floating-point_format double precision IEEE754] 64-bit floating point value.{{v5}}
 
|}</onlyinclude>
 
|}</onlyinclude>
  

Revision as of 10:42, 13 October 2016

See Also

Double

Double Data Types are available in SHIPv5 and onwards, and are double precision IEEE754 floating point values.

Data Type Description
Double A double precision IEEE754 64-bit floating point value.Badge SHIPv5.gif

Double constants in SHIPTide must be written with a decimal point, at least one digit before and one digit after the decimal point, with a trailing "d".

Examples of Double constants:

  • 1.0d is 1.0
  • -2.324d is -2.324
  • .3d is invalid, since there are no digits in front of the decimal point; add a leading 0
  • 1d is invalid, since there is no decimal point nor trailing digits after the decimal point
  • 1.d is invalid, since there are no trailing digits after the decimal point

Casting Rules

From To Description
Double Byte fractional elements removed, fit within the Byte range
Double Short fractional elements removed, fit within the Short range
Double Integer fractional elements removed
Double Boolean a value of false if exactly 0.0d, otherwise true
Double Byte fractional elements removed, fit within the Byte range
Byte Double simple cast
Short Double simple cast
Integer Double simple cast, but limited to maximum and minimum Double range which is smaller than Integer
Boolean Double a value of 0.0d for false and 1.0d for true