HELP: restore my faith in Python

Ken Seehof kens at sightreader.com
Mon Mar 6 04:00:52 EST 2000


Seems to me an improvement would be to have python artificially
add epsilon to floats before converting to int.  This would still
suck but IMHO it would suck less.

Yeah, I know it's artificial, but it's not rocket science.  Everyone
knows that int(0.99999999999999999999993427) == 1 is more
correct than int(0.99999999999999999999993427) == 0.  I
challenge anyone to come up with a real world situation where the
latter answer is more valuable.

I'll let the experts figure out what exactly epsilon should be.


As for the more general question about integer division:  I'd have
to say that my 20 years of programming experience makes me
totally unqualified to answer that one.

I suggest the Alice approach: find out what "non-programmers"
expect the behaviour to be, commit to that, then do the best you
can to formalize the rules so "real programmers" can figure out
what to expect too.

Unfortunately, I have a feeling that most "real programmers",
including myself, will probably be somewhat annoyed at the results.
After all, we think integer division is sometimes useful.  we geeks are
alSo goIng to be anNoyed when GuiDo reMoves case senSiTiViTy.

c'est-la-vie-ly y'rs
Ken Seehof <kens at sightreader.com>





More information about the Python-list mailing list