<br><br><div class="gmail_quote">On Thu, Apr 8, 2010 at 7:29 PM, Doug Burke <span dir="ltr">&lt;<a href="mailto:doug_j_burke@yahoo.com">doug_j_burke@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
--- On Thu, 4/8/10, Gregory Crosswhite &lt;<a href="mailto:gcross@phys.washington.edu">gcross@phys.washington.edu</a>&gt; wrote:<br>
<br>
&gt; From: Gregory Crosswhite &lt;<a href="mailto:gcross@phys.washington.edu">gcross@phys.washington.edu</a>&gt;<br>
<br>
&gt;<br>
&gt; On a tangental note, I&#39;ve considered coding up a package<br>
&gt; with an &quot;AlmostEq&quot; typeclass that allows one to test for<br>
&gt; approximate equality.  The problem is that different<br>
&gt; situations call for different tolerances so there is no<br>
&gt; standard &quot;approximate equal&quot; operator that would work for<br>
&gt; everyone, but there might be a tolerance that is &quot;good<br>
&gt; enough&quot; for most situations where it would be needed (such<br>
&gt; as using QuickCheck to test that two different<br>
&gt; floating-point functions that are supposed to return the<br>
&gt; same answer actually do so) to make it worthwhile to have a<br>
&gt; standard package for this around for the sake of<br>
&gt; convenience.<br>
&gt;<br>
&gt; Anyone have any thoughts on this?<br></blockquote><div><br></div><div>I&#39;ve always wondered if Haskell would make it easy to track number of significant digits.  The other thought is that you could probably use Oleg&#39;s implicit configurations to handle the tolerance in a rather nice way:</div>
<a href="http://www.cs.rutgers.edu/~ccshan/prepose/prepose.pdf">http://www.cs.rutgers.edu/~ccshan/prepose/prepose.pdf</a></div><div class="gmail_quote"><br></div><div class="gmail_quote">The example in the paper is managing the modulus implicitly and I would imagine the amount of precision could be managed similarly.</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">Jason</div>