Double type stores 64-bit floating-point values.
range: ±5.0 × 10−324 to ±1.7 × 10308
precision: 15-16 digits
By default, a real numeric literal on the right side of the assignment operator is treated as double, but if you want an integer number to be treated as double, use the suffix d or D.
double x = 10D;
Integral types and floating-point types can be mixed in an expression:
- If one type is double the expression evaluates to double
- If no double type in the expression it evaluates to float
int x = 1;
float y = 2.5f;double w = 1.2E+1;
MessageBox.Show ("The sum is: " + (x + y + w).ToString());