# Why does Cantor's diagonal argument not work for rational numbers?

If we map every integer to a string that represents a rational number, and produce a number different from all the ones listed, we are essentially following Cantor's algorithm. But why does it not apply? Is it because we can't be certain that the number produced is a rational number?

-
If you have an explicit countable ordering of the rational numbers and an explicit version of Cantor's algorithm (watching out for the $0.5000\ldots=0.4999\ldots$ issue), then this gives you a way of generating a guaranteed irrational number. – Henry May 22 '11 at 21:11