[MacRuby] #433: Results of rand() is not obviously uniformly distributed
#433: Results of rand() is not obviously uniformly distributed -----------------------------------+---------------------------------------- Reporter: nagachika00@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: -----------------------------------+---------------------------------------- Hi Kernel#rand(nil) should generate random Float numbers distributed uniformly between 0.0 <= x < 1.0. But current MacRuby rand() generate obviously non-uniform distributed sequence. It NEVER generate a number smaller than 0.1! I have wrote a small patch. I check that work fine with AO Bench result image. Thanks. -- Ticket URL: <http://www.macruby.org/trac/ticket/433> MacRuby <http://macruby.org/>
#433: Results of rand() is not obviously uniformly distributed -----------------------------------+---------------------------------------- Reporter: nagachika00@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | -----------------------------------+---------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.5 Comment: Thank you very much for the report as well as the patch, it's greatly appreciated. I merged it in r3013. -- Ticket URL: <http://www.macruby.org/trac/ticket/433#comment:1> MacRuby <http://macruby.org/>
#433: Results of rand() is not obviously uniformly distributed -----------------------------------+---------------------------------------- Reporter: nagachika00@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | -----------------------------------+---------------------------------------- Comment(by jkh@…): Actually, this is more of an argument for arc4random(). See how to drop it in as a replacement for random() by reading man page, specifically the EXAMPLES section. -- Ticket URL: <http://www.macruby.org/trac/ticket/433#comment:2> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby