[Haskell-cafe] floating-point comparison (was haskell gsoc proposal for richer numerical type classes and supporting algorithms)

Doug Burke doug_j_burke at yahoo.com
Thu Apr 8 22:29:18 EDT 2010

--- On Thu, 4/8/10, Gregory Crosswhite <gcross at phys.washington.edu> wrote:

> From: Gregory Crosswhite <gcross at phys.washington.edu>

> On a tangental note, I've considered coding up a package
> with an "AlmostEq" typeclass that allows one to test for
> approximate equality.  The problem is that different
> situations call for different tolerances so there is no
> standard "approximate equal" operator that would work for
> everyone, but there might be a tolerance that is "good
> enough" for most situations where it would be needed (such
> as using QuickCheck to test that two different
> floating-point functions that are supposed to return the
> same answer actually do so) to make it worthwhile to have a
> standard package for this around for the sake of
> convenience.
> Anyone have any thoughts on this?

It's always worth pointing out


at this point (not that it really helps you out in this case)



More information about the Haskell-Cafe mailing list