|
From: | Alex Shinn |
Subject: | Re: [Chicken-users] Using epsilon in test egg |
Date: | Mon, 28 Jul 2014 21:46:57 +0900 |
Alex Shinn scripsit:
It isn't, though, not quite. What it needs to do is not a dichotomy of
> The solution is definitely not to write your own comparison function,
> and trust that the test egg is doing the right thing.
"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.
[Prev in Thread] | Current Thread | [Next in Thread] |