DOUBLE¶
double-precision 64-bit IEEE 754 floating point. The range of its values is beyond the scope of this discussion, but is specified in the Floating-Point Types, Formats, and Values section of the Java Language Specification.
LITERAL NOTATION: A double numeric can be expressed in decimal or scientific notation. The values can be preceded by a minus sign and followed by the letter ‘d’ or ‘D’:
decimal: 2.0 -4.44d
scientific: 2.4E-24D 3e2
Converting to double¶
1 2 | DOUBLE(numeric_expr)
DOUBLE(string_expr)
|
- converts numeric expression to double value
- converts string expression to double value
Expressions¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 2d > 1 // => TRUE
2d < 1 // => FALSE
2d = 2 // => TRUE
2d >= 1 // => FALSE
2d <= 3 // => TRUE
2d + 1 // => 3.0
1d - 1 // => 0.0
2d * 2 // => 4.0
2d / 2 // => 1.0
5d % 2 // => 1.0
1d & 0d // => 0
1d | 0d // => 1
1d ^ 1d // => 0
1d << 1d // => 2
1d >> 1d // => 0
1d >>> 1d // => 0
~ 1d // => -2
BIT_COUNT(1d) // => 1
|
See also