That could fail with integers too large to be exactly represented with doubles, however. Numbers can be hard to work with.