View Single Post
  #30 (permalink)  
Old 04-09-2008, 09:15 PM
shaalini shaalini is offline
D-Web Analyst
 
Join Date: Apr 2007
Posts: 342
shaalini is on a distinguished road
Default Re: Ruby BuiltIn functions

srand
srand( [ aNumber ] ) -> oldSeed


Seeds the pseudorandom number generator to the value of aNumber.to_i.abs. If aNumber is omitted or zero, seeds the generator using a combination of the time, the process id, and a sequence number. (This is also the behavior if Kernel::rand is called without previously calling srand, but without the sequence.) By setting the seed to a known value, scripts can be made deterministic during testing. The previous seed value is returned.
__________________
Shaalini.S
Be the Best of Whatever you are...
Reply With Quote