Intervals
Peter Crowther
Peter.Crowther at IT-IQ.com
Tue Nov 30 17:35:41 UTC 1999
> val _ aNumber - self first / self increment.
> ^ ( val - val rounded ) abs < 1e-10
This takes no account of the bounds AFAICS*; it needs fuzzy checks for upper
and lower bounds, which previous versions have done. However, it deals
neatly with the scaling problem.
* Try (1500 to: 1700 by: 0.01) valuesInclude: 0. I get val as (0 - 1500) /
0.01 = -150,000. val - val rounded will be close to 0, and the test will
return true.
- Peter
More information about the Squeak-dev
mailing list
|