Nan compares with Rational

https://code.google.com/p/sympy/issues/detail?id=4123