I think this is a better way of detecting double is integer.