Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Random(); How much accurate ?

Status
Not open for further replies.

hisheeraz

Programmer
Mar 24, 2003
28
AU
Hello friends.
This Random(); method in C# System library. How much accurate is it? Does it really Generates random Numbers? I have looked into the previous threads and found some people saying this is not really a random generator...use Cryptography. what difference it makes?

And from memory i can tell there was a rand(); functionin c++ that generated random number number but it generated the same number all the time unless i actually made time involved with that function.

I donot see any time invilvement with this Random(); method in C#.
So is it really Random Number Generator? if yes How accurate? and if no then where does it go Wrong?

Thanks and Regards


§ Rented Lips §
----------------
Begning To Learn
----------------
 
Random is a pseudo-random number generator. Eventually, if you request enough numbers, it will repeat.

If you want really good random numbers, investigate the RNGCryptoServiceProvider in the System.Security.Cryptography namespace.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top