>> I feel
>>      7/3  should give -2
>>
>> since  integer  divison returns floor
>
> The floor is the next lowest integer to the float.
> floor(-3.000000001) will be -4
> floor(3.99999999) will be 3


Hi Joseph,

If it helps, draw out the floor function out on a piece of graph paper.

           ^
           |
          2|     x==O
           |
          1|  x==O
           |
<---------x==O------->
           |
        x==O
           |
     x==O  |
           |
           V

I'm using the "x==O" to try to graphically draw out the half-open 
intervals.

If you believe this diagram, then the results you're seeing from integer 
division should make sense.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to