Intervals

Jan Theodore Galkowski algebraist at salonmember.com
Tue Dec 7 06:33:44 UTC 1999


On Wed, 1 Dec 1999 13:11:11    Jarvis, Robert P. wrote:

[snip]

>> There is no way to compare floats
>> for equality that does not fail because of base conversion or
>> computational error problems.

[snip]

>
>> Note that FORTRAN, the most
>widely used scientific and
>engineering programming language
(80% or more of the market) does
not havme ~fuzz~. There is no
reason why Smalltalk needs it
either.

>>
>But FORTRAN has no concept of
>encapsulation, so fuzz factors get
>sprinkled willy-nilly through the
>code.  With FuzzyIntervals I'm
>attempting to encapsulate the fuzz
>(lint trap? :-), at least as far as
>Intervals go.

Well, to me it seems there are two
choices.  One can consider a subset
of the reals which is 1-1 with a
subset of the integers, translating
between the two using something
affine:  An offset and a fixed
scale factor.  Then, OTOH, one can
consider the fuzz-based interval,
perhaps biased towards the reals,
where the comparison tolerance is
calculated as a function of the
hosting machine epsilon and the
programmer's notion of what it
means for two values to be "near"
each other for the application.  It
is unlikely one test of nearness
will generalize to more than one
context.

[snip]

  --jt



---
___________________________________________
demiourgos at smalltalk.org        squeak.org/
home.stny.rr.com/algebraist/ 
www.smalltalk.org/ jtgalkowski at alum.mit.edu





Get your FREE, private e-mail account at http://www.salonmember.com.





More information about the Squeak-dev mailing list