[bug] my first squeak bugfix - Interval>>includes:

Jarvis, Robert P. Jarvisb at timken.com
Fri Jul 30 12:37:02 UTC 1999


I don't think that's necessarily true.  Intervals work fine with non-integer
start, stop, and increment values - but if you're using Floats you must
beware of roundoff errors.  Try inspecting

	(0.1 to: 1.0 by: 0.1) asOrderedCollection

and view the results.  The values appear correct - but if you evaluate

	((0.1 to: 1.0 by: 0.1) asOrderedCollection at: 9) - 0.9

you get -1.110223024625156e-16, indicating that some roundoff error has
begun to creep in.

Floats suck.

Bob Jarvis
The Timken Company

> -----Original Message-----
> From:	Peter Smet [SMTP:peter.smet at flinders.edu.au]
> Sent:	Friday, July 30, 1999 2:40 AM
> To:	squeak at cs.uiuc.edu
> Subject:	Re: [bug] my first squeak bugfix - Interval>>includes:
> 
> Sorry,
> 
> I just looked at the Interval creation method,
> and see that increment must be an Integer.
> Ignore my previous posts (blush)(although it would
> be nice if intervals could have smaller steps)..
> 
> Peter
> 
> 





More information about the Squeak-dev mailing list