IEEE double has a 52-bit mantissa, plus there is a hidden bit, so effectively 53-bit mantissa. So you can exactly represent all integers up to 53 binary bits in IEEE double exactly. So 53 1's would be the largest integer with all 1's. Add one to that and you get a 54-bit integer that is a 1 followed by 53 0's, which because of the trailing 0's is also exactly representable in IEEE double (i.e., the last 0 is not representable, but because it is a 0 it doesn't affect the value). Add one more to that and you get a 54-bit integer that is a 1 followed by 52 0's followed by a 1. This is not representable exactly in IEEE double because of the 53-bit mantissa limitation. So the smallest integer number that cannot be represented exactly in IEEE double is the 54-bit binary integer 100...001, which is decimal
'9007199254740992' <-- IEEE Double can't handle that extra 1
9007199254740993 <-- uint64 has full 64 bits available for value
Another clue is to use eps( ) to find the value of the least significant bit:
Since this value is greater than 1, that tells you that we are beyond the precision of IEEE Double to handle neighboring integers exactly.