[New-bugs-announce] [issue16460] Strange results for floor division ("//") with non-integer divisors

Tom Pohl report at bugs.python.org
Mon Nov 12 09:25:05 CET 2012


New submission from Tom Pohl:

According to the documentation of the floor division (http://docs.python.org/2/reference/expressions.html#binary-arithmetic-operations), x//y should be equal to math.floor(x/y).

However, the result of 1//0.1 is 9.0 (tested on 2.6, 2.7, 3.2).

It might be related to the internal representation of floating-point numbers, but for this example I would expect it to come up with the correct values.

Cheers,
Tom

----------
components: None
messages: 175424
nosy: Tom.Pohl
priority: normal
severity: normal
status: open
title: Strange results for floor division ("//") with non-integer divisors
type: behavior
versions: Python 2.6, Python 2.7, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16460>
_______________________________________


More information about the New-bugs-announce mailing list