The Random
.NET class provides two methods: NextDouble
and Sample
. Both document that they return, "A double-precision floating point number greater than or equal to 0.0, and less than 1.0." Sample
does document some comments about how as of .NET 2.0, it's not used for several other NextX
methods, but I'm not really clear on what implications this has.
So what is the difference between these two methods? What is the intended usage of each? And more specifically, if I'm just after a uniformly distributed value between 0.0
and 1.0
, which should I use?