[Numpy-discussion] ceil returns real ?
Sturla Molden
sturla at molden.no
Wed Jul 28 19:16:14 EDT 2010
>> Wed, 28 Jul 2010 14:26:36 +0200, Mark Bakker wrote:
>>> > I don't understand why ceil and floor return real values [snip]
>>> > Wouldn't an integer make more sense?
>
>
> On 7/28/2010 9:39 AM, Pauli Virtanen wrote:
>> Which integer? Only arbitrary-size integers (Python longs) are able to
>> span the whole floating-point range, but we don't necessarily want
>> np.ceil(some_array)
>> to start returning object arrays, because of efficiency reasons.
>
>
> Makes sense. But couldn't a ``dtype`` argument still be useful?
np.ceil(some_array).astype(int)
Sturla
More information about the NumPy-Discussion
mailing list