POV-Ray : Newsgroups : povray.programming : random numbers in c++ : Re: random numbers in c++ Server Time
23 Apr 2024 17:12:30 EDT (-0400)
  Re: random numbers in c++  
From: Slime
Date: 26 Aug 2010 02:05:50
Message: <4c76043e$1@news.povray.org>
> this has not been my experience.  printing the result of one million 
calls to
 > rand() gives numbers up to ten digits long, but I've never seen a 
result less
 > than six digits in length.  If every result were equally likely, 
there should be
 > SOME lower numbers in the batch, shouldn't there?

If your rand() gives you numbers between 0 and, say, 9999999999 (the 
largest number that is ten digits long), then 99.99% of those numbers 
will be over six digits in length. That's assuming that all numbers in 
the range are possible, which would not be the case if, say, it were 
taking a random integer from 0 to 32767 and then multiplying it to be 
much higher.

  - Slime


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.