On Tue, Jun 28, 2011 at 2:36 PM, Masklinn <masklinn@masklinn.net> wrote:
On 2011-06-28, at 15:31 , Tom Evans wrote:Unless you've switched to Python 3, or imported division from __future__ in which case true division is the default, and integer division is bumped to '//'.
>
> Bit OT, but I'll bite (doesn't really relate to Django). Dividing two
> ints ALWAYS returns an int.
Or he was expecting that Python uses true division always (a default the core team seems to agree with since they changed it in 3.0)
> Calling math.ceil() ALWAYS returns a
> float. I think you were expecting that python would automagically
> store the remainder somewhere so that math.ceil() has something to
> operate on. It doesn't do that!
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment