Manuscript (Case [Issue]22467) Number - Float should not implement #to:, #to:by:, etc...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Manuscript (Case [Issue]22467) Number - Float should not implement #to:, #to:by:, etc...

Pharo Issue Tracker
Manuscript Notification
avatar
Julien Delplanque opened Case 22467: Float should not implement #to:, #to:by:, etc... and assigned it to Everyone:
Bug in Project:  Number: 1. Pharo Image  •  You are subscribed to this case
Indeed, there are many errors made when you increment floats successively. e.g.:

(0.0 to: 1.0 by: 0.1) asArray >>> #(0.0 0.1 0.2 0.30000000000000004 0.4 0.5 0.6000000000000001 0.7000000000000001 0.8 0.9 1.0)

I think creating interval of float should be either forbidden or at least a warning should be raised.

The correct solution here is to use ScaledDecimal.e.g.

(0.0s1 to: 1.0s1 by: 0.1s1) asArray >>> #(0.0s1 0.1s1 0.2s1 0.3s1 0.4s1 0.5s1 0.6s1 0.7s1 0.8s1 0.9s1 1.0s1)
Priority Priority: 5 – Fix If Time Status Status: Work Needed
Assigned To Assigned to: Everyone Milestone Milestone: Later

Go to Case
No longer need updates? Unsubscribe from this case.

Don't want Manuscript notifications anymore? Update your preferences.

Manuscript

_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
https://lists.gforge.inria.fr/mailman/listinfo/pharo-bugtracker