Python 3.0 new integer division

Hutch ABH at MCHSI.COM
Tue Apr 8 12:13:00 EDT 2008


We now have a float result when two integers are divided in the same mannor 
as 2.4 or 2.5.
I can handle that and use the Floor division but a simple question.

Why in the world would you round down the last presented digit to a 6 
instead of just leaving it along as an 8.
For some reason rounding down for a float in Python does not seem correct.

IDLE 3.0a4

>>> 12345678901234567890123456789012345678901234567890/345
3.5784576525317586e+46


>>> 12345678901234567890123456789012345678901234567890//345
35784576525317588087314367504383610663481839327
                                ^
                                ^|
35784576525317586000000000000000000000000000000  == 3.5784576525317586e+46





More information about the Python-list mailing list