[Numpy-discussion] ceil returns real ?

Robert Kern robert.kern@gmail....
Wed Jul 28 12:02:16 CDT 2010


On Wed, Jul 28, 2010 at 11:48, Alan G Isaac <aisaac@american.edu> wrote:
>> 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?

Probably, but you would have to add it to all ufuncs.

-- 
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


More information about the NumPy-Discussion mailing list