Double precision numbers are accurate up to sixteen decimal places but after calculations have been done there may be some rounding errors to account for. In theory this should affect no more than the last significant digit but in practice it is safer to rely upon fewer decimal places.
A double is a 64 bit IEEE 754 floating-point. Double can provide precision up to 15 to 16 decimal points.
Double is more precise than float and can store 64 bits, double of the number of bits float can store.
double has 2x more precision than float. float is a 32 bit IEEE 754 single precision Floating Point Number – 1 bit for the sign, 8 bits for the exponent, and 23* for the value. float has 7 decimal digits of precision.
What is the guaranteed accuracy of multiplication operator for double values in java?
For example, 2.2 * 100 is 220.00000000000003, but 220 is a double number. 220.00000000000003 is the next double after 220.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With