dbd wrote: > On Dec 6, 1:12 am, Raymond Hettinger <pyt...@rcn.com> wrote: >> On Dec 5, 11:42 pm, Tim Roberts <t...@probo.com> wrote: >> >>> Raymond Hettinger <pyt...@rcn.com> wrote: >>>> if not round(x - y, 6): ... >>> That's a dangerous suggestion. It only works if x and y happen to be >>> roughly in the range of integers. > .> > .> Right. Using abs(x-y) < eps is the way to go. > .> > .> Raymond > > This only works when abs(x) and abs(y) are larger that eps, but not > too much larger.
Okay, I'm confused now... I thought them being larger was entirely the point. At what point can they become too large? Isn't eps entirely arbitrary anyway? > > Mark's suggestion is longer, but it works. The downside is it requires > you to think about the scale and accuracy of your application. > Shouldn't one be doing that in any case?? Roger. -- http://mail.python.org/mailman/listinfo/python-list