[Numpy-discussion] Oddity with numpy.int64 integer division

Christian Marquardt christian@marquardt...
Tue Apr 24 16:31:05 CDT 2007


On Tue, April 24, 2007 23:08, Robert Kern wrote:
> Christian Marquardt wrote:
>> Restore the invariant, and follow python.
>>
>> This
>>
>>    >>> -5 // 6
>>    -1
>>
>> and
>>
>>    >>> array([-5])[0] // 6
>>    0
>>
>> simply doesn't make sense - in any language, you would expect that
>> all basic operators provide you with the same same answer when
>> applied to the same number, no?
>
> Not if they are different types, you don't, e.g. -5.0 / 6 .

But I would regard an integer and an array of integers as the same type.

  Christian.




>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless
> enigma
>  that is made terrible by our own mad attempt to interpret it as though it
> had
>  an underlying truth."
>   -- Umberto Eco
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>




More information about the Numpy-discussion mailing list