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.