<br><br><div><span class="gmail_quote">On 3/14/08, <b class="gmail_sendername">Greg Ewing</b> <<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Neil Toronto wrote:<br> <br> > Don't forget a !~ b, a <~ b, and a >~ b, and the associated __sim__,<br> > __nsim__, __ltsim__, and __gtsim__ slots.<br> <br> <br>I think that all of these are a bad idea. In my experience,<br>
 when comparing with a tolerance, you need to think carefully<br> about what the appropriate tolerance is for each and every<br> comparison. Having a global default tolerance would just<br> lead people to write sloppy and unreliable numerical code.</blockquote>
<div><br>Agreed no quick "fix" for float imprecisions is going to make life better for programmers beyond the first week.  floats are imprecise.  the sooner programmers learn that the better.  if you want things that can be compared without thinking use a decimal and avoid irrational numbers. good luck. ;)<br>
<br>Though I don't use them myself I believe the popular math language packages like matlab and mathematica may even allow you to compute all values with second error/precision component that gets mutated properly based on the computations being done so that you know the accuracy of your result without manually having to calculate accuracy every step of the way based on the algorithm and order of floating point operations used.  (if not, its an interesting idea and could be fleshed out as a pure python object implementation  by someone who cares about these things to see if enough people find it useful).<br>
<br></div>-gps<br></div>