chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Using epsilon in test egg


From: John Cowan
Subject: Re: [Chicken-users] Using epsilon in test egg
Date: Mon, 28 Jul 2014 08:30:07 -0400
User-agent: Mutt/1.5.20 (2009-06-14)

Alex Shinn scripsit:

> The solution is definitely not to write your own comparison function,
> and trust that the test egg is doing the right thing.

It isn't, though, not quite.  What it needs to do is not a dichotomy of
"if inexact, use epsilon, otherwise use `equal?`" but rather to have
a version of `equal?` that uses epsilon when it comes to a float.
That way comparisons against list or vector structure that contains
floats (as in the OP's case) will work correctly.

-- 
John Cowan          http://www.ccil.org/~cowan        address@hidden
What has four pairs of pants, lives in Philadelphia,
and it never rains but it pours?
        --Rufus T. Firefly



reply via email to

[Prev in Thread] Current Thread [Next in Thread]