[Numpy-discussion] Bitwise operations and unsigned types
Fri Apr 6 01:22:55 CDT 2012
> Although 1.5.1 also gives
> >>> np.uint(3) + 4
> i.e., a float, which certainly doesn't look right either. Whereas
> >>> np.int(3) + 4
> The float promotion is still there in 1.6.1
> In : uint64(1) + 2
> Out: 3.0
> So I suppose there is the larger question is how combining numpy scalars with python scalars should be done in general.
Yes, exactly! This is a good discussion to have. As mentioned before, I would also like to see the NumPy scalars get their own math instead of re-using the umath machinery. In the case of scalars, it would seem to make sense to interpret integers as signed or unsigned based on their value.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion