Projects

Ticket #436 (closed defect: duplicate)

Opened 2 years ago

Last modified 14 months ago

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

Attachments

test.rb Download (273 bytes) - added by macruby@… 2 years ago.
source code
611.rb Download (60 bytes) - added by emil@… 14 months ago.
reduction

Change History

Changed 2 years ago by macruby@…

source code

Changed 23 months ago by lsansonetti@…

  • summary changed from Strange pair(?) of bugs to Strange pair(?) of bugs (floats)

Changed 14 months ago by emil@…

reduction

Changed 14 months ago by emil@…

duplicte of #611

Changed 14 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to duplicate
  • milestone MacRuby 0.5 deleted
Note: See TracTickets for help on using tickets.