POV-Ray : Newsgroups : povray.general : Random 8 digit number problem : Random 8 digit number problem Server Time
19 Apr 2024 07:54:27 EDT (-0400)
  Random 8 digit number problem  
From: Anthraqunione
Date: 19 Feb 2018 07:25:01
Message: <web.5a8ac107279b8aeacd4c57b30@news.povray.org>
Povray 3.7

I want an 8 digit random interger and used thisi code

#declare Random       = true;                   // User random number for image
#declare Seed         = 1001011;
#if (Random = true)
  #local R = seed (Seed);
  #declare S  = rand(R);
  #declare S = int(S*100000000);
#end

I started with Seed = 1 and was planning to work upwards as I expected each
final number the be "random".  I found the final 2 or 3 digits repeated and
started trying different values of Seed.  This is what I got

1               42199287
2               84398287
3               26597287

10              21990288
11              64189288

101             62099296
102             04298296

1000001         42286854
1000002         84485854

1001001         41286941
1001011         63276942

Are the above results what is expected ?.  It seems that only the first three
digits generated are anything like random

AQ


Post a reply to this message

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