[Numpy-discussion] ceil returns real ?

Sebastian Haase seb.haase@gmail....
Wed Jul 28 07:54:16 CDT 2010


On Wed, Jul 28, 2010 at 2:26 PM, Mark Bakker <markbak@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.
>
> Thanks,
>
Hi Mark,

I don't know the answer,
but Python 2.x has similar behavior for the built-in round():
round(2.7)  returns 3.0 (float!)
I think I read that Python 3.2 will change this to
round(2.7)  returning 3 (int!)

- Sebastian Haase


More information about the NumPy-Discussion mailing list