Re: [Python-Dev] nice()

2006-02-16 Thread Andrew Lentvorski
Smith wrote: > Everyone knows that fp numbers must be compared with caution, but > there is a void in the relative-error department for exercising such > caution, thus the proposal for something like 'areclose'. The problem > with areclose(), however, is that it only solves one part of the > proble

Re: [Python-Dev] nice()

2006-02-15 Thread Greg Ewing
Smith wrote: > The problem with areclose(), however, is that it > only solves one part of the problem that needs to be solved > if two fp's *are* going to be compared: if you are going to > check if a < b you would need to do something like > > not areclose(a,b) and a < b No, no, no. If

Re: [Python-Dev] nice()

2006-02-15 Thread Raymond Hettinger
[Smith] > The following discussion ends with things that python-dev might want to > consider in terms of adding a function that allows something other than the > default 12- and 17-digit precision representations of numbers that str() and > repr() give. Such a function (like nice(), perhaps name

Re: [Python-Dev] nice()

2006-02-15 Thread Smith
I am reluctantly posting here since this is of less intense interest than other things being discussed right now, but this is related to the areclose proposal that was discussed here recently. The following discussion ends with things that python-dev might want to consider in terms of adding a

Re: [Python-Dev] nice()

2006-02-14 Thread Terry Reedy
"Greg Ewing" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I don't think you're doing anyone any favours by trying to protect > them from having to know about these things, because they *need* to > know about them if they're not to write algorithms that seem to > work fine on test

Re: [Python-Dev] nice()

2006-02-14 Thread Greg Ewing
Smith wrote: > computing the bin boundaries for a histogram > where bins are a width of 0.1: > for i in range(20): > ... if (i*.1==i/10.)<>(nice(i*.1)==nice(i/10.)): > ... print i,repr(i*.1),repr(i/10.),i*.1,i/10. I don't see how that has any relevance to the way bin boundaries would be

Re: [Python-Dev] nice()

2006-02-13 Thread Raymond Hettinger
Please do not spam multiple mail lists with these posts (edu-sig, python-dev, and tutor). Raymond - Original Message - From: "Smith" <[EMAIL PROTECTED]> To: Cc: ; Sent: Monday, February 13, 2006 12:10 PM Subject: Re: [

Re: [Python-Dev] nice()

2006-02-13 Thread Smith
| From: Josiah Carlson <[EMAIL PROTECTED]> | "Alan Gauld" <[EMAIL PROTECTED]> wrote: || However I do dislike the name nice() - there is already a nice() in || the || os module with a fairly well understood function. perhaps trim(), nearly(), about(), defer_the_pain_of() :-) I've waited to think

Re: [Python-Dev] nice()

2006-02-12 Thread Greg Ewing
Smith wrote: > When teaching some programming to total newbies, a common frustration > is how to explain why a==b is False when a and b are floats computed > by different routes which ``should'' give the same results (if > arithmetic had infinite precision). This is just a special

[Python-Dev] nice()

2006-02-12 Thread Smith
I've been thinking about a function that was recently proposed at python-dev named 'areclose'. It is a function that is meant to tell whether two (or possible more) numbers are close to each other. It is a function similar to one that exists in Numeric. One such implementation is   def arec