[M3devel] random.longint()?

Jay K jay.krell at cornell.edu
Sun May 16 01:22:42 CEST 2010


Fair enough. I guess random.longint() could just call random.integer() twice, or clients could, existing situation, do nothing.

 - Jay


----------------------------------------
> From: hosking at cs.purdue.edu
> Date: Sat, 15 May 2010 12:36:25 -0400
> To: jay.krell at cornell.edu
> CC: m3devel at elegosoft.com
> Subject: Re: [M3devel] random.longint()?
>
> I hesitate to slow down the default implementation of random by using LONGINT (slow) instead of INTEGER (fast).
>
> On 15 May 2010, at 03:03, Jay K wrote:
>
>>
>> In libm3 there is random number generation.
>> In libm3 that is code that wants 8 random bytes.
>> If integer is 4 bytes, it calls random.integer() twice, else if it is 8, once.
>>
>> It seems natural that we should provide random.longint()?
>>
>> And then the other code can just use it?
>>
>> Someone can look into the random number generator and
>> - make sure it is actually "correct" for 64bit integer?
>> - and if so, change the lowest level to use LONGINT
>> and layer integer over it? -- not sure how, presumably
>> taking only the lower 32bits loses too much randomness?
>>
>>
>> This is what I get for looking into why we are ever asked to extract 0 bits..
>>
>> "Everywhere I look, I see bugs." (topic of a separate mail)
>>
>> - Jay
>>
>>
>
 		 	   		  


More information about the M3devel mailing list