negative numbers and integer division
mark at hahnca.com
Fri Oct 3 21:16:49 CEST 2003
That definitely seems wrong to me, even though it is a correct "floor"
I was given the impression that (int // int) was going to be the replacement
for (int / int) when (int / int) is changed to return a float, but -1/12 now
gives 0, not -1, so (int // int) is not a replacement for (int / int).
"Matthew Wilson" <mwilson at sarcastic-horse.com> wrote in message
news:mailman.1065206646.19185.python-list at python.org...
> I just discovered this:
> >>> -1 // 12
> >>> 1 // 12
> I thought that -1 // 12 would be 0 also. I'm writing a simple monthly
> date class and i need (-1,2001) to be translated to (11,2000). Any ideas?
More information about the Python-list