-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interval includes: discrepancy #1108
Comments
Thanks for the bug report Nicolas. From the code history this is obviously of very long standing, but hasn't been reported before. This suggests it is not a common use case, and/or that impact is low. As such, although it would be nice to fix, any fix would have to be very carefully made so as not to significantly impact the performance of more mainstream cases. As Dolphin's VM is an interpreter, the lower layers of the class library need to remain "tight" to keep the system snappy. |
The 2nd example seems to be a common problem. I get the same incorrect results in Pharo 9.0 (build 1168), and in VW 8,3. Here is another expression of it with results from VW: interval := (0.3d to: 0.82d by: 0.01d).
interval includes: interval asArray last. "false!" |
Yes, this is neither specific to Dolphin, nor urgent. The strategies are the following:
In the 2nd option, we do not want to spoil the simplicity and efficiency of the most general case (Interval of Integer or eventually Fraction), so my recommandation would be to create a LimitedPrecisionInterval, and let Note that stop has to be tested because of size... For example, following Interval is pathological, though containing no Float and having an Integer step...
|
Yes, that seems like a good approach. |
Interval size is not consistent with Interval includes:
I like very much the definition of
includes:
from John Brandt, but things are not as consistent as possible.Similarly, current definition of size can lead to an element greater than the stop bound:
Should size be changed for accomodating the Float case ?
For example it could be in case of inexact arithmetic:
The text was updated successfully, but these errors were encountered: