reverse digits of an integer