[Python-bugs-list] Divide overflow (follow-on to bug #88) (PR#169)

sjmachin@lexicon.net sjmachin@lexicon.net
Mon, 3 Jan 2000 04:55:51 -0500 (EST)


Full_Name: John Machin
Version: 1.5.2
OS: Win NT w/s 4.0
Submission from: (NULL) (203.12.210.3)


[sorry if this shouldn't be a new bug report but I couldn't nut out how to add
on to the existing report]

There is a dilemma here: BIGNEG / -1 should cause an overflow exception, not a
crash. Pedantry would say that BIGNEG % -1 should *not* cause an exception, but
return a result of zero. However / and % are computed by the same function,
which doesn't know which answer the punter wants (could even be both). 

Practicality says that if someone's code executes BIGNEG % -1, they either know
exactly what they're doing (checking to see what will happen), or they don't
have a clue at all (it's not really a very meaningful computation, is it?), in
which case throwing an exception is (IMO) acceptable --- I'm just suggesting
that this be added to the documentation in the reference manual.