Turn off ZeroDivisionError?
Steve Holden
steve at holdenweb.com
Fri Feb 15 14:35:34 EST 2008
Mark Dickinson wrote:
> On Feb 14, 11:09 pm, John Nagle <na... at animats.com> wrote:
>> You also need to think about how conditionals interact with
>> quiet NANs. Properly, comparisons like ">" have three possibilities:
>
> True. There was a recent change to Decimal to make comparisons (other
> than !=, ==) with NaNs do the "right thing": that is, raise a Python
> exception, unless the Invalid flag is not trapped, in which case they
> return False (and also raise the Invalid flag). I imagine something
> similar would make sense for floats.
>
>> True, False, and "raise". Many implementations don't do that well,
>> which means that you lose trichotomy. "==" has issues; properly,
>> "+INF" is not equal to itself.
>
> I don't understand: why would +INF not be equal to itself? Having
> INF == INF be True seems like something that makes sense both
> mathematically and computationally.
> [...]
There are an uncountable number of infinities, all different.
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
More information about the Python-list
mailing list