Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27415

VS 2022 VB.net VS2022 => How to generate random number that is a Single or Double

$
0
0
Trying to generate a Single or Double random number between 0 and 1 inclusive of 0 and 1.

I can use rnd() method & it works but everyone on the various VB fora claim this is a bad way to do it (old & pseudorandom length too short)

I have tried "RandomNumberGenerator.GetInt32" and apparently this is a better method but seems to only generate integer values. I need Single/Double capability.
I do not need Crypto (just doing science Monte Carlo calculation) but would love a really long sequence before repeats.

Thanks for any help guys!

Viewing all articles
Browse latest Browse all 27415

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>