[Python-Dev] The Case Against Floating Point ==

2008-03-13 Thread Imri Goldberg
Heya I've been using Python for development for some years now, but up until now, I didn't participate much in work on Python itself. I've decided to 'take a shot at it', even if a small one at first. To the subject at hand: Most experienced programmers know that you shouldn’t compare floating

Re: [Python-Dev] The Case Against Floating Point ==

2008-03-13 Thread Aahz
On Thu, Mar 13, 2008, Imri Goldberg wrote: My suggestion is to do either of the following: 1. Change floating point == to behave like a valid floating point comparison. That means using precision and some error measure. 2. Change floating point == to raise an exception, with an error string

Re: [Python-Dev] The Case Against Floating Point ==

2008-03-13 Thread Mark Dickinson
On Thu, Mar 13, 2008 at 4:20 AM, Imri Goldberg [EMAIL PROTECTED] wrote: My suggestion is to do either of the following: 1. Change floating point == to behave like a valid floating point comparison. That means using precision and some error measure. 2. Change floating point == to raise an

Re: [Python-Dev] The Case Against Floating Point ==

2008-03-13 Thread Terry Reedy
Imri Goldberg [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | Most experienced programmers know that you shouldn't compare floating | point numbers with ==. As a general statement, this is wrong. Mark gave examples. Please drop the proposal. The reason for the int division change

Re: [Python-Dev] The Case Against Floating Point ==

2008-03-13 Thread Tiago A.O.A.
I would suggest something like a ~= b, for approximately equal to. How approximately? Well, there would be a default that could be changed somewhere. Don't know if it's all that useful, though. Tiago A.O.A. Terry Reedy escreveu: Imri Goldberg [EMAIL PROTECTED] wrote in message news:[EMAIL