[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: |
Sat, 26 Jul 2014 21:47:42 -0400 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Matt Gushee scripsit:
> 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.
Other posters have addressed the main issues, but I'll just point out
that "inexact comparison" means "comparison for equality of inexact
numbers". Epsilon is applied only by the default predicate: it's
assumed that if you write your own equality predicate, you know what
you want.
= also works correctly for all floats. It's computation itself that
isn't always mathematically correct, which is why Scheme speaks of
inexact (i.e. inexactly computed) numbers.
--
John Cowan http://www.ccil.org/~cowan address@hidden
May the hair on your toes never fall out! --Thorin Oakenshield (to Bilbo)
Re: [Chicken-users] Using epsilon in test egg, Alex Charlton, 2014/07/26
Re: [Chicken-users] Using epsilon in test egg,
John Cowan <=