POV-Ray : Newsgroups : povray.general : rand question : Re: rand question Server Time
5 Aug 2024 02:18:03 EDT (-0400)
  Re: rand question  
From: Warp
Date: 12 Feb 2003 09:59:22
Message: <3e4a614a@news.povray.org>
Tom Melly <tom### [at] tomandlucouk> wrote:
> Once I'd worked out what the code did, the same thought occured - is there
> something in the way the stream is generated that makes that impossible? For
> example, that a particular number is always followed by another fixed number?

  This depends a lot on how the random number generator is implemented.
There are (good) random number generators where the period is a lot larger
than the value range (eg. you get numbers between 0 and 2^64-1 from it, but
it gives you for example 2^256 numbers before starting over, which of course
means that the same number appears in the stream several times).
  As I don't have any idea what kind of algorithm pov's generator uses,
I can't say how it works there. Very simple generators start repeating
over immediately when the same number which has appeared before appears
again.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

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