Re: [Numpy-discussion] Precision in Python

2006-12-05 Thread Nadav Horesh
-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:

Re: [Numpy-discussion] Precision in Python

2006-12-05 Thread Charles R Harris
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

Re: [Numpy-discussion] Precision in Python

2006-12-05 Thread Tim Hochberg
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

[Numpy-discussion] Precision in Python

2006-12-05 Thread Elton Mendes
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