FIX issue#8147 Recursion depth exceeded in as_int(Rational(0, 0))