Re: float and random number generator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Micha,

On Wed, Jun 09, 2004 at 01:13:29PM +0300, Micha Feigin told us:
> I think (get_random_bytes_returned & max_value) will give you proper
> results only if max_value = (2^n)-1. for example if max_value = 4 you
> will either get 4 or 0 as output. If its 3 you will get 0-3.
> 

Yeah, sorry about that, recognized it after thinking about it for
some time. Bit operations are not my best side ;-)

Sven

-- 
Linux zion 2.6.7-rc2 #2 Mon May 31 22:58:01 CEST 2004 i686 athlon i386 GNU/Linux
 13:07:53  up 8 days, 14:07,  1 user,  load average: 0.00, 0.01, 0.00

Attachment: pgp00588.pgp
Description: PGP signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux