Barry,
On UV10.0.16, HPUX11i, I get a reasonable distribution:

0001:       DIM DISTRIB(10) ; MAT DISTRIB = 0
0002:       FOR I = 1 TO 999999
0003:          THIS.NUM = RND(370570)
0004:          DISTRIB( 1+ INT( THIS.NUM/37057 ) )+= 1
0005:       NEXT
0006:       FOR I = 1 TO 10
0007:          CRT I, DISTRIB(I)
0008:       NEXT

>RUN CDS.BP R
1         99870
2         99853
3         99957
4         100267
5         100168
6         100257
7         100115
8         99556
9         100146
10        99810
>.X
01 RUN CDS.BP R
1         100445
2         99652
3         100301
4         99603
5         99867
6         100032
7         99785
8         99436
9         100211
10        100667
> 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Barry Brevik
Sent: Wednesday, November 10, 2004 11:03 AM
To: U2-users (E-mail)
Subject: [U2] [UV] Random number (RND()) help

UV 9.6.1.3 on NT.
I needed to generate some random numbers between 0 and 370570, and just
to check the distribution of numbers, I ran this snippet of code:

FOR I = 1 TO 999999
  THIS.NUM = RND(370570)
NEXT

What's odd is that no matter how many times I run this, the distribution
of numbers is always completely in the lower 10% of the range (approx).
In other words, there are never any numbers generated higher than ~
33,000.

Am I doing something stupidly wrong?

Barry
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to