Re: float and random number generator

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

 



On Monday 07 June 2004 09:23, aksingh@hss.hns.com wrote:
>
> Thanks Sven, but would a & not be better than a % to get a value
> between 0 and my max value, i.e i can do a (get_random_bytes_returned
> & max_value). Does this in anyway reduce randomnness ?
> Any suggestions are welcome.

Unless your 'max_value' is always something like (2^n)-1 you'll have a 
lot less randomness -- potentially only 1-bit worth.



--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[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