-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Elton Mendes
Sent: Monday, November 27, 2006 13:57
To: numpy-discussion@scipy.org
Subject: [Numpy-discussion] Precision in Python
Hi.
I'm having a precision problem in python
Example:
On 11/27/06, Elton Mendes <[EMAIL PROTECTED]> wrote:
Hi.
I'm having a precision problem in python
Example:
>>> a = 5.14343434
>>> b = round(a,1)
>>> b
5.0996
>>>
It´s possible to round the number exactly to 5.1
Short answer, no. The number 5.1 can't be exactly represented as a
Elton Mendes wrote:
> Hi.
> I'm having a precision problem in python
>
> Example:
>
>
> >>> a = 5.14343434
> >>> b = round(a,1)
> >>> b
> 5.0996
> >>>
>
> It´s possible to round the number exactly to 5.1
Read this:
http://www.python.org/infogami-faq/general/why-are-floating-point-calc
Hi.
I'm having a precision problem in python
Example:
a = 5.14343434
b = round(a,1)
b
5.0996
It´s possible to round the number exactly to 5.1
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mail