[Qt-interest] Best Random Number Generator in Qt

M. Bashir Al-Noimi mbnoimi at gmx.com
Thu Apr 15 18:46:50 CEST 2010


Hi,

There are many ways for creating randoms, try the following ways 
(attached files).


On 15/04/2010 02:05 م, Aaron Lewis wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
> 	For example , i'd like to get a integer range from 0 to max , i can use
> such a function:
>
> int mpainter::getRandomNumber(int max)
> {
>      return double(qrand()) / RAND_MAX * max;
> }
>
> But i don't think this is a good way to generate it , i always got a
> number two.
>
> Is there any good method to generate random number in range ?
>
> Appreciate any of your help ;-)
>
> - -- 
> Best Regards,
> Aaron Lewis - PGP: 0x4A6D32A0
> FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
> irc: A4r0n on freenode
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.14 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkvHAQ8ACgkQvf41sEptMqDEIgCfZYyF2NIR3sEr+/ldA5vSWVxt
> 84EAnibCo5O54pDnw5W3EY0E5hPWTXL5
> =SrC/
> -----END PGP SIGNATURE-----
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>    

-- 
Best Regards
Muhammad Bashir Al-Noimi
My Blog: http://mbnoimi.net

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100415/533f55fe/attachment.html 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ystandardrandom.h
Url: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100415/533f55fe/attachment.h 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ytausworthe.h
Url: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100415/533f55fe/attachment-0001.h 


More information about the Qt-interest-old mailing list