[Numpy-discussion] Possible
Michal Radwanski
mr395415 at students.mimuw.edu.pl
Sun Feb 28 19:30:41 EST 2021
Hello,
I'm not sure if it's expected behaviour or a bug, so I decided to write
here. First an example:
In [4]: array([2**63])
Out[4]: array([9223372036854775808], dtype=uint64)
In [5]: array([2**63-1, 2**63])
Out[5]: array([9.22337204e+18, 9.22337204e+18])
The docs for `numpy.array` mention, that:
dtype : data-type, optional
The desired data-type for the array. If not given, then the type
will be determined as the minimum type required to hold
the objects in the sequence.
I understand the type promotions here, but I believe that the
documentation is wrong in this case. Indeed, the minumum type in the
latter case would be 'uint64'.
Is it a bug worth submitting/fixing?
--
Z wyrazami szacunku
Michał Radwański
With kind regards
Michał Radwański
More information about the NumPy-Discussion
mailing list