[Python-Dev] PEP239 (Rational Numbers) Reference Implementation and new issues

Fernando Pérez fperez528 at yahoo.com
Thu Oct 3 17:11:27 EDT 2002


Chad Netzer wrote:

>> Dunno about NaN, but wouldn't rational(Inf) be 1/0?

1/0 -> NaN, b/c you can only define it as a limit and the value of the limit 
depends on whether you come into 0 from the right or from the left.

> And what about rational 0/0?  Is that 1, or NaN (or Inf :-) )?

NaN. This one isn't defined even as a limit. In expressions that go to 0/0, 
you need to figure out which one (num/den) goes faster to 0 to be able to 
answer. Long faded memories of calc. classes trickle in ...

Cheers,

f.

ps. I'm not a mathematician, I only play one on TV. But if anyone wants to 
whip us with a real analysis text for the gory details, I won't fight back.



More information about the Python-list mailing list