On Feb 10, 5:50 pm, Ben Finney <[EMAIL PROTECTED]>
wrote:
> Mark Dickinson <[EMAIL PROTECTED]> writes:
> > On Feb 10, 3:29 pm, Grant Edwards <[EMAIL PROTECTED]> wrote:
> > > platform does".  Except it doesn't in cases like this. All my
> > > platforms do exactly what I want for division by zero: they
> > > generate a properly signed INF.  Python chooses to override
> > > that (IMO correct) platform behavior with something surprising.
> > > Python doesn't generate exceptions for other floating point
> > > "events" -- why the inconsistency with divide by zero?
>
> > But not everyone wants 1./0. to produce an infinity;  some people
> > would prefer an exception.
>
> Special cases aren't special enough to break the rules.
>
> Most people would not want this behaviour either::
>
>     >>> 0.1
>     0.10000000000000001
>
> But the justification for this violation of surprise is "Python just
> does whatever the underlying hardware does with floating-point
> numbers". If that's the rule, it shouldn't be broken in the special
> case of division by zero.

Do you recall what the very next Zen after "Special cases aren't
special enough to break the rules" is?


that's-why-they-call-it-Zen-ly yr's,

Carl Banks

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to