Kernel#rand implementation does not match mri and rbx
-----------------------------------------------------

                 Key: JRUBY-5697
                 URL: http://jira.codehaus.org/browse/JRUBY-5697
             Project: JRuby
          Issue Type: Bug
            Reporter: Aman Gupta
            Assignee: Thomas E Enebo


this breaks certain test frameworks that assume calling srand will result in a 
specific repeatable sequence of random numbers.

it looks like there is a compatible random implementation in 
org.jruby.util.Random, but it is not being used.

{noformat}
$ /usr/bin/ruby -ve 'srand(1); p rand'
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
0.417022004702574
{noformat}

{noformat}
$ ruby -ve 'srand(1); p rand'
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.6.0]
0.417022004702574
{noformat}

{noformat}
$ ruby -ve 'srand(1); p rand' 
rubinius 1.2.4dev (1.8.7 d9624587 yyyy-mm-dd JI) [x86_64-apple-darwin10.6.0]
0.417022004702574
{noformat}

{noformat}
$ ruby -ve 'srand(1); p rand'
jruby 1.6.0 (ruby-1.8.7-p330) (2011-04-05 2701790) (Java HotSpot(TM) 64-Bit 
Server VM 1.6.0_24) [darwin-x86_64-java]
0.730878190703291
{noformat}


-- 
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