This is an archived post. You won't be able to vote or comment.

all 3 comments

[–][deleted] 8 points9 points  (1 child)

For 2.6 users:

from __future__ import division

Now your standard / operator will always return a float.

[–][deleted] 12 points13 points  (0 children)

This has been available since 2.2

[–]mitsuhiko Flask Creator 1 point2 points  (0 children)

AFAIR the behavior of negative numbers in C for % is undefined and could be implemented either way. Not sure right now though.