From: Chad Perrin Date: 2007-09-15T22:43:45+09:00 Subject: Re: rand() v. rand(0.1) ? On Sat, Sep 15, 2007 at 09:09:52PM +0900, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: rand() v. rand(0.1) ?" > on Sat, 15 Sep 2007 20:35:37 +0900, Chad Perrin writes: > > |Speaking of which . . . obviously rand() doesn't produce a truly random > |number, but it's reasonably close for some purposes. I'm curious about > |just how far off it is, though -- because I'm curious about how > |appropriate it is to use to simulate dice-rolling for gaming software (in > |the "roleplaying game" sense of the term "gaming") in Ruby's > |implementation. > > It uses Mersenne Twister algorithm which has a period of 2**19937-1. Excellent! Thank you for the quick and informative response. -- CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] Amazon.com interview candidate: "When C++ is your hammer, everything starts to look like your thumb."