adding unsigned int and int
Hi, Is this intended? [~/] [1]: np.result_type(np.uint, np.int) [1]: dtype('float64') [~/] [2]: np.version.version [2]: '2.0.0.dev-aded70c' Skipper
Hi, On Tue, Dec 6, 2011 at 4:45 AM, Skipper Seabold <jsseabold@gmail.com> wrote:
Hi,
Is this intended?
[~/] [1]: np.result_type(np.uint, np.int) [1]: dtype('float64')
I would guess so - if your system ints are 64 bit. int64 can't contain the range for uint64, nor can uint64 contain all int64, If there had been a larger int type, it would promote to int, I believe. At least on my system: In [4]: np.result_type(np.int32, np.uint32) Out[4]: dtype('int64') Best, Matthew
On Tue, Dec 6, 2011 at 7:53 AM, Matthew Brett <matthew.brett@gmail.com> wrote:
Hi,
On Tue, Dec 6, 2011 at 4:45 AM, Skipper Seabold <jsseabold@gmail.com> wrote:
Hi,
Is this intended?
[~/] [1]: np.result_type(np.uint, np.int) [1]: dtype('float64')
I would guess so - if your system ints are 64 bit. int64 can't contain the range for uint64, nor can uint64 contain all int64, If there had been a larger int type, it would promote to int, I believe. At least on my system:
In [4]: np.result_type(np.int32, np.uint32) Out[4]: dtype('int64')
Makes sense. Thanks, Skipper
participants (2)
-
Matthew Brett -
Skipper Seabold