[Numpy-discussion] Precision in Python

Tim Hochberg tim.hochberg at ieee.org
Tue Dec 5 13:20:29 EST 2006


Elton Mendes wrote:
> Hi.
> I'm having a precision problem in python
>
> Example:
>
>
> >>> a = 5.14343434
> >>> b = round(a,1)
> >>> b
> 5.0999999999999996
> >>>
>
> It´s possible to round the number exactly to 5.1

Read this: 
http://www.python.org/infogami-faq/general/why-are-floating-point-calculations-so-inaccurate/






More information about the NumPy-Discussion mailing list