Subject: re: 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/14/2000 15:39:39
I decided to download gawk-3.0.4.tar.gz from a GNU mirror site and compile
it on a 3000/400 which is running 1.4.1.  Curiously enough, using the gawk
it produced with the command shown below gave expected results, ie.
identical to the ones from the i386 machine I mentioned originally; but
/usr/bin/awk still produces minute values.

Anyone have any idea why?


Ray


>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