Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #76325 > unrolled thread

Re: Odd floor-division corner case

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2014-08-14 11:46 -0600
Last post2014-08-14 11:46 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Odd floor-division corner case Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-14 11:46 -0600

#76325 — Re: Odd floor-division corner case

FromIan Kelly <ian.g.kelly@gmail.com>
Date2014-08-14 11:46 -0600
SubjectRe: Odd floor-division corner case
Message-ID<mailman.13006.1408038440.18130.python-list@python.org>
On Thu, Aug 14, 2014 at 11:31 AM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote:
> From http://bugs.python.org/issue22198
>
>>>> -0.5 // float('inf')
> -1.0

Looks like the result is the same for any negative dividend.

> What should it be?

It's surprising, but I think it's correct. A negative infinitesimal
would be less than 0, so its floor should be -1, not 0.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web