[1.9] Leading underscores handling in String's hex, to_i, to_f different from 
MRI
---------------------------------------------------------------------------------

                 Key: JRUBY-4424
                 URL: http://jira.codehaus.org/browse/JRUBY-4424
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules, Intro, RubySpec
    Affects Versions: JRuby 1.4
            Reporter: Vladimir Sizikov


For 1.8, JRuby and MRI behavior is the same:

{noformat}
ruby -ve "p '_9'.to_f; p '_9'.hex; p '_9'.to_i(10)"
ruby 1.8.7 (2009-06-12 patchlevel 174) [i386-mswin32]
9.0
9
9
{noformat}

{noformat}
jruby -ve "p '_9'.to_f; p '_9'.hex; p '_9'.to_i(10)"
jruby 1.5.0.dev (ruby 1.8.7 patchlevel 174) (2010-01-05 6d85f3b) (Java 
HotSpot(TM) Client VM 1.6.0_17) [x86-java]
9.0
9
9
{noformat}

But for 1.9, MRI changed its behavior, not JRuby:

{noformat}
ruby -ve "p '_9'.to_f; p '_9'.hex; p '_9'.to_i(10)"
ruby 1.9.2dev (2009-11-12 trunk 25723) [i386-mingw32]
0.0
0
0
{noformat}

{noformat}
jruby --1.9 -ve "p '_9'.to_f; p '_9'.hex; p '_9'.to_i(10)"
jruby 1.5.0.dev (ruby 1.9.2dev trunk 24787) (2010-01-05 6d85f3b) (Java 
HotSpot(TM) Client VM 1.6.0_17) [x86-java]
9.0
9
9
{noformat}

See also: http://redmine.ruby-lang.org/issues/show/2562 (this is an 
acknowledgment from ruby-core team that the change is intentional).


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to