[BUG][FIX] Interval method includes:

Wolfgang Eder w.eder at avibit.com
Thu Jun 17 13:52:05 UTC 2004

Boris Gaertner wrote:
> I think now that it is perhaps best to write:
> valuesInclude: aNumber
>     | val |
>  val _ (aNumber - self first)  / self increment.
>  ^val isFloat
>    ifTrue: [val fractionPart abs < 1.0e-10]
>    ifFalse: [val isInteger]
> This version uses exact calculation without
> floats whenever that is possible. It also
> avois unnecessary computations with
> fractions.

how about adding a protocol like #fractionPartIsZero
or #isFractionPartZero, with implementations
in Integer, Fraction, and Float?
Just my 2c.. regards,

More information about the Squeak-dev mailing list