Mantis - Squeak
|
|||||||||||||||
Viewing Issue Advanced Details | |||||||||||||||
|
|||||||||||||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: | ||||||||||
6455 | Collections | minor | always | 04-29-07 14:31 | 09-10-08 17:38 | ||||||||||
|
|||||||||||||||
Reporter: | nicolas cellier | Platform: | |||||||||||||
Assigned To: | OS: | ||||||||||||||
Priority: | normal | OS Version: | |||||||||||||
Status: | closed | Product Version: | |||||||||||||
Product Build: | Resolution: | duplicate | |||||||||||||
Projection: | none | ||||||||||||||
ETA: | none | Fixed in Version: | |||||||||||||
|
|||||||||||||||
Summary: | 0006455: [BUG] Interval includes: is weird | ||||||||||||||
Description: |
Try this: (0 to: Float pi by: Float pi / 100) includes: Float pi * (3/100) Answer is false. I do agree with this result, because Float cannot be tested for equality due to inexact arithmetic. However, if you look at includes: implementation, you will see some machinery intended to make the answer true is failing. |
||||||||||||||
Steps To Reproduce: | |||||||||||||||
Additional Information: |
Why the code does not work: -------------------------- Float pi * (3/100) / (Float pi /100) is (inexactly) 2.9999... , thus fractional part is greater than 1.0e-10 step. Should behaviour be different from super ? ---------------------------------------- This is arguable... (0 to: Float pi by: Float pi / 100) asArray includes: (Float pi * 14)/100. "is false" (0 to: Float pi by: Float pi / 100) includes: (Float pi * 14)/100. "is true" |
||||||||||||||
Relationships |
| ||||||||||||||
Attached Files: |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|