[#11073] segfault printing instruction sequence for iterator — <noreply@...>

Bugs item #10527, was opened at 2007-05-02 14:42

14 messages 2007/05/02
[#11142] Re: [ ruby-Bugs-10527 ] segfault printing instruction sequence for iterator — Nobuyoshi Nakada <nobu@...> 2007/05/10

Hi,

[#11188] Re: [ ruby-Bugs-10527 ] segfault printing instruction sequence for iterator — Paul Brannan <pbrannan@...> 2007/05/16

On Thu, May 10, 2007 at 04:51:18PM +0900, Nobuyoshi Nakada wrote:

[#11234] Planning to release 1.8.6 errata — Urabe Shyouhei <shyouhei@...>

Hi all.

17 messages 2007/05/25

[ ruby-Bugs-10935 ] eval("0.0025 + 9 * 0.0025") === 0.025 => false

From: <noreply@...>
Date: 2007-05-20 18:14:00 UTC
List: ruby-core #11209
Bugs item #10935, was opened at 2007-05-20 20:13
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=10935&group_id=426

Category: Core
Group: 1.8.x
Status: Open
Resolution: None
Priority: 3
Submitted By: Boris Schmid (bor_)
Assigned to: Nobody (None)
Summary: eval("0.0025 + 9 * 0.0025") === 0.025  => false

Initial Comment:
Eval is being (inconsistently) strange. 

It's acting normal when I do the (8 * 0.0025) example, and not acting normally when I do the (9 * 0.0025) example. Plenty of other combinations where it repeatedly does the same.


boris:alive:~:irb
irb(main):001:0> eval("0.0025 + 9 * 0.0025")
=> 0.025
irb(main):002:0> eval("0.0025 + 9 * 0.0025") === 0.025
=> false
irb(main):003:0> eval("0.0025 + 8 * 0.0025")
=> 0.0225
irb(main):004:0> eval("0.0025 + 8 * 0.0025") === 0.0225
=> true
irb(main):005:0> exit
boris:alive:~:ruby -v
ruby 1.8.5 (2006-12-25 patchlevel 12) [i686-linux]


Same for ruby 1.8.5 (2006-12-25 patchlevel 12) [i386-mswin32]
Same for ruby 1.8.6 (2006-12-25 patchlevel 12) [i386-mswin32]

For windows ruby 1.8.6, the below sample give some more insight into the bug:

irb(main):001:0> eval("1 + 9 * 1")
=> 10
irb(main):002:0> eval("1 + 9 * 1") === 10
=> true
irb(main):003:0> eval("0.1 + 9 * 0.1")
=> 1
irb(main):004:0> eval("0.1 + 9 * 0.1") === 1
=> true
irb(main):005:0> eval("0.01 + 9 * 0.01") === 0.1
=> false
irb(main):006:0> exit


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=10935&group_id=426

In This Thread

Prev Next