[Numpy-discussion] ceil returns real ?

2010-07-28 Thread Mark Bakker
Hello list, I don't understand why ceil and floor return real values, while the doc string says: The ceil of the scalar `x` is the smallest integer `i` Wouldn't an integer make more sense? Numpy version 1.3.0. Thanks, Mark ___ NumPy-Discussion

Re: [Numpy-discussion] ceil returns real ?

2010-07-28 Thread Sebastian Haase
On Wed, Jul 28, 2010 at 2:26 PM, Mark Bakker mark...@gmail.com wrote: Hello list, I don't understand why ceil and floor return real values, while the doc string says: The ceil of the scalar `x` is the smallest integer `i` Wouldn't an integer make more sense? Numpy version 1.3.0.

Re: [Numpy-discussion] ceil returns real ?

2010-07-28 Thread Alan G Isaac
On 7/28/2010 8:26 AM, Mark Bakker wrote: I don't understand why ceil and floor return real values The same for ``round``. (Note that Python 3 rounds to int.) Furthermore, it would be nice if each took a ``dtype`` argument. Alan Isaac ___

Re: [Numpy-discussion] ceil returns real ?

2010-07-28 Thread Pauli Virtanen
Wed, 28 Jul 2010 14:26:36 +0200, Mark Bakker wrote: I don't understand why ceil and floor return real values, while the doc string says: The ceil of the scalar `x` is the smallest integer `i` Wouldn't an integer make more sense? Which integer? Only arbitrary-size integers (Python longs)

Re: [Numpy-discussion] ceil returns real ?

2010-07-28 Thread Alan G Isaac
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

Re: [Numpy-discussion] ceil returns real ?

2010-07-28 Thread Robert Kern
On Wed, Jul 28, 2010 at 11:48, Alan G Isaac ais...@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

Re: [Numpy-discussion] ceil returns real ?

2010-07-28 Thread Sturla Molden
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

Re: [Numpy-discussion] ceil returns real ?

2010-07-28 Thread Pauli Virtanen
Thu, 29 Jul 2010 01:16:14 +0200, Sturla Molden wrote: [clip] Makes sense. But couldn't a ``dtype`` argument still be useful? np.ceil(some_array).astype(int) That's one temporary more. The dtype= argument for all ufuncs wouldn't probably hurt too much. -- Pauli Virtanen