Subject: Very small numbers from awk's rand()
To: None <port-alpha@netbsd.org>
From: Ray Phillips <r.phillips@mailbox.uq.edu.au>
List: port-alpha
Date: 05/10/2000 12:55:06
Dear Port Alpha:

Can anyone tell me why NetBSD/alpha 1.4.1's awk's rand() function produces
such small results?

Typing this command

          awk '{for(i=1;i<=10;i++) print rand(); exit}'

followed by two <returns> gives this output:

1.135e-10
1.66615e-11
9.20415e-13
1.93928e-10
1.78174e-10
1.39659e-10
3.06831e-11
2.06295e-10
1.70529e-11
7.96164e-11

but on a NetBSD/i386 system the result is:

0.487477
0.0715607
0.00395315
0.832913
0.765252
0.599829
0.131783
0.88603
0.0732417
0.34195

which seems much more reasonable.


Ray Phillips