On Sep 18, 2014 2:31 AM, "Petr Viktorin" <encukou@gmail.com> wrote:

>

> For the record, this gives inf in Numpy.

>

> >>> import numpy

> >>> numpy.array(float('inf')) // 1

> inf

>

> AFAIK this and http://bugs.python.org/issue22198 are the only

> differences from Python floats, at least on my machine.

That's an interesting bug report and it's significantly different (mathematically speaking) from the discussion here. That aside, I have to wonder if numpy has its own way of representing infinity and how that behaves. I still maintain that it's least surprising for float('inf') // 1 to be NaN. You're trying to satisfy float('inf') = mod + 1 * y and in this case mod and y are both indeterminate (because this is basically a nonsensical equation).