[Numpy-discussion] why numpy.round get a different result from python round function?

shuwj5460 at 163.com shuwj5460 at 163.com
Tue Mar 10 01:26:51 EDT 2009


hi,

I read the doc for numpy about round function:

-----
For values exactly halfway between rounded decimal values, Numpy rounds
to the nearest even value. Thus 1.5 and 2.5 round to 2.0, -0.5 and 0.5
round to 0.0, etc. Results may also be surprising due to the inexact
representation of decimal fractions in the IEEE floating point standard
[16] and errors introduced when scaling by powers of ten.
----

why not numpy round  keep the same with python round function? or
provide anothor function to do so?

               david.shu
               2009.3.10

-- 
 <>





More information about the NumPy-Discussion mailing list