Ticket #436 (closed defect: duplicate)
Strange pair(?) of bugs (floats)
| Reported by: | macruby@… | Owned by: | lsansonetti@… |
|---|---|---|---|
| Priority: | blocker | Milestone: | |
| Component: | MacRuby | Keywords: | |
| Cc: |
Description
I am writing some code, see attached, in ruby and have run into a strange pair of bugs, I think. I'm using 'MacRuby version 0.5 (ruby 1.9.0) [universal-darwin10.0, x86_64]'
When I go to execute the attached code I have come across two problems which I think are bugs. First when I run this line [line 20] of code 'd = Test.new(9.1)' I get the following response '##-<Test:0x200274f20 @min=9.09999999999999>' which is wrong.
Second, when I execute this line [line 24] of code 'c << d' I get '@min=10.0>, ##-<Test:0x20020d2e0 @min=10.1>, ##-<Test:0x200274f20 @min=9.09999999999999>' which is also wrong. It should look like this '@min=9.09999999999999>, ##-<Test:0x2000e5e60 @min=10.0>, ##-<Test:0x20020d2e0 @min=10.1>' which it does if I execute this line of code 'c.sort!'.
Executing all of this in 'ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]' returns the expected results.
- AYAL


