in reply to Re^6: 64-bit digest algorithms
in thread 64-bit digest algorithms
I think that rather depends on what 'max' one is looking for. In this case the 'max' in question is the largest 2^(n-1) - 1 that can be exactly represented in floating form (IEEE 754 64-bit binary). This value corresponds to the maximum (positive) value of an n bit +ve 2's complement integer -- which was the object of interest.
Update: in the interests of clarity, the striken stuff in the next two paragraphs may be ignored, and in the second of the two, the underlined stuff replaces the striken stuff.
The reason this works is because when i = 54 the normalised intermediate result of the floating point sum (2^54) - 1 is 54 '1's, thus: 1.111...111:1 where the '.' is the binary point, the 111...111 is the 52 bit fraction, and the :1 is the rounding bit. This is then rounded to even. (I'll gloss over how and why this is round to even and not round up.)
Whereas, when i = 53 for (2^53) - 1 the intermediate result is 53 '1's, so no rounding, and there is an all '1's mantissa, which is what one was looking for.
The point was to show that a useful subset of the values representable in floating point form contains all the values of a signed (2's complement) integer of at most 54 bits.
I was not trying to show how many other integer values can be exactly represented as floating point values. One of those is +2^53, which just happens to be right next to the maximum 54-bit signed (2's and 1's complement) integer value. So what ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: 64-bit digest algorithms
by ikegami (Patriarch) on Nov 17, 2008 at 02:37 UTC | |
by gone2015 (Deacon) on Nov 17, 2008 at 15:22 UTC |