Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The maximum value of double is greater than the maximum value of long because they represent different types of data. Long is an integer type that can store whole numbers with a precision of up to 64 bits or 8 bytes. Double is a floating-point type that can store decimal numbers with a precision of up to 64 bits or 8 bytes as well. However, double uses some of its bits to store the exponent, which allows it to represent larger values than long. Therefore, even though they have the same memory size, double can represent larger values due to its ability to represent fractional values and a wider range of numbers.