[BUG][FIX] Interval method includes:

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


Boris Gaertner wrote:
[snip]
> 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.
[snip]

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






More information about the Squeak-dev mailing list