Issue 3733 in pharo: Float>>roundUpTo: wrong results

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

Issue 3733 in pharo: Float>>roundUpTo: wrong results

pharo
Status: New
Owner: ----

New issue 3733 by [hidden email]: Float>>roundUpTo: wrong results
http://code.google.com/p/pharo/issues/detail?id=3733


Try this: (test casa in attachenment)

560.19 roundUpTo: 0.01 >>> 560.2
500.19 roundUpTo: 0.01 >>> 500.19

Attachments:
        RoundUpToTests.st  560 bytes


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3733 in pharo: Float>>roundUpTo: wrong results

pharo
Updates:
        Status: WontFix

Comment #1 on issue 3733 by [hidden email]: Float>>roundUpTo: wrong  
results
http://code.google.com/p/pharo/issues/detail?id=3733

Don't put too many expectations on Float, they are inexact:
560.19 > 560.19s2 -> true
500.19 < 500.19s2 -> true
QED

Please use ScaledDecimal.
560.19s2 roundUpTo: 0.01s2. 560.19s2
500.19s2 roundUpTo: 0.01s2. 500.19s2
560.19s2 roundUpTo: 0.1s2. 560.20s2
500.19s2 roundUpTo: 0.1s2. 500.20s2