On 27/07/14 01:42, Matt Gushee wrote:

> I can certainly define a custom equality predicate that will do what I
> need, but this is bugging me. I guess I don't really understand how
> epsilon is supposed to work. The test egg documentation says that
> applies to 'inexact comparisons', but I can't find a definition of
> 'inexact comparison'. I have also read that '=' may be unreliable for
> inexact numbers, but I don't know what else to use. Perhaps 'fp=' from
> the Chicken library? Then I would have to ensure that all numbers are
> expressed as floats, whereas currently my code has a number of cases
> where 1 and 0 are expressed as integers.

As I understand it, the test egg epsilon won't change the behaviour of =
- it's used purely internally by the test egg when you say the likes of:

(test 1.0 (+ 0.5 0.5))

It's probably best to define your own equality predicate, I think!

ABS

-- 
Alaric Snell-Pym
http://www.snell-pym.org.uk/alaric/

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to