Don't return infinity!

If you typed a very big number with -r, the program got stuck in an infinite loop.