How can I mathematically show the largest possible value of a 64-bit double?
Assuming IEEE754 64 bit format:
You have an 11 bit exponent field, a 1 bit sign field, and a 52 bit mantissa field.
The exponent field can have values from 0 to 2047. An exponent field of 0 is reserved for denormalized numbers, and an exponent field of 2047 is reserved for infinity and Not-a-number. You could say that +Infinity is the largest value, but I assume you are looking for the largest finite value. The largest exponent field for a finite value is 2046.
This format has an &quot;exponent bias&quot; of 1023, that is the numbers 1.0 ≤ x &lt; 2.0 have an exponent field of 1023. So the largest value has an unbiased exponent of 2046 - 1023 = 1023, and numbers with an exponent field of 2046 are in the range $2^{1023} ≤ x &lt; 2 \cdot 2^{1023}$.
The mantissa field is 52 bit, with an implicit leading 1 bit. So a mantissa field with a value m, 0 ≤ m ≤ $2^{52}$, means the actual mantissa is 1 + $m \cdot 2^{-52}$. The largest possible mantissa field is all bits 1 or $2^{52}-1$, this makes the largest possible mantissa $2-2^{-52}$.
Multiply with the exponent, and the largest possible number is $2^{1023} \cdot (2-2^{-52})$ or $2^{1024} \cdot (1-2^{-53})$ or $2^{1024} - 2^{971}$