Quote Originally Posted by iMalc View Post
Less likely to be a problem of course, but a double still far exceeds the range of a long long. So 2^100 (which is exactly representable in a double) isn't a whole number with that approach.
But then you probably already knew that.
I forgot to add that this will actually work if you check the double for being outside the range of about say -2^60 to 2^60 first, returning true in that case, because a double doesn't have enough significand bits to represent such large numbers with any decimal places at all.