[Numpy-discussion] bug in ceil()

Michael Droettboom mdroe at stsci.edu
Wed Oct 6 13:57:45 EDT 2010


Are you sure?

In [4]: type(np.ceil(-0.0))
Out[4]: <type 'numpy.float64'>

Mike

On 10/06/2010 01:55 PM, Christian Fischer wrote:
> Hi All,
>
> I use numpy 1.4.1 on Debian squeeze amd64.
>
> I noticed that ceil() is not working properly.
>
> If the input to ceil() is a float I expect a float to be returned but for inputs
> in (-1.0, 0.0) the result is of type integer.
>
> In [65]: np.__version__
> Out[65]: '1.4.1'
>
> In [66]: np.ceil(-1.1)
> Out[66]: -1.0
>
> In [67]: np.ceil(-0.734)
> Out[67]: -0
>
> In [68]: np.ceil(-0.256)
> Out[68]: -0
>
> In [69]: np.ceil(-0.0)
> Out[69]: -0
>
> In [70]: np.ceil(0.2)
> Out[70]: 1.0
>
> Best wishes
> Christian
>
>
>    
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>    


-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20101006/2a470a91/attachment.html>


More information about the NumPy-Discussion mailing list