[Newbies] Re: What's wrong with this statement?

Jerome Peace peace_the_dreamer at yahoo.com
Fri Aug 1 23:58:08 UTC 2008

[Newbies] Re: What's wrong with this statement?

HI Tim, Hi Randal

Randal, I'm with Tim on this one.
Random has no way of knowing how many bits to supply.
LargeInteger knows how many it needs
 and can inquire of random how many it can get.
So LargeInteger>>atRandom has the responsibility to get the job done.

Asking for enough random numbers for all the bits in question.  
One random can decide on the high order bit range.
The next on the low order range within that etc
 until you have decide on all the choices. 
You can employing more than one random generator. 
That would probably insure better distribution of results.

Tim, this is an excelent bug find. 
Please plant a seed on mantis.
We need somewhere to put the patch and the tests for the harvesters.

The really important thing is to have a test (sunit)
 that can be run to validate if an image has the fix or not.
 Any (or all) of the ones in this thread look like good starts.

Yours in curiosity and service, --Jerome Peace

>Randal L. Schwartz merlyn at stonehenge.com 
>Thu Jul 31 20:45:44 UTC 2008 
>>>>>> "Timothy" == Timothy J Miller <tmiller at mitre.org> writes:
Timothy>> It certainly is inconsistent to have an Integer method that doesn't
Timothy>> invisibly handle large ints.
Randal>The Integer method is fine.  The problem is the lack of bits from the PRNG
Randal>from class Random.


More information about the Beginners mailing list