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

From Serious Documentation
Jump to: navigation, search
 
Line 5: Line 5:
 
<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.
 
<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 double precision IEEE754] 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.
 
|}</onlyinclude>
 
|}</onlyinclude>
  

Latest revision as of 12:13, 14 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.

Double constants in SHIPTide must be written with a decimal point, at least one digit before and one digit after the decimal point. There is not specific Double designator, like Float's "f", to make a number a double.

Examples of Double constants:

  • 1.0 is 1.0
  • -2.324 is -2.324
  • .3 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, trailing digits after the decimal point, nor is "d" a Double designator
  • 1.d is invalid, since there are no trailing digits after the decimal point nor is "d" a Double designator

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.0, 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.0 for false and 1.0 for true