SHIP:Data Types:Double

From Serious Documentation
Revision as of 10:42, 13 October 2016 by CarltonHeyer (talk | contribs)
Jump to: navigation, search

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