Returns a random number that is between 0 and 1.
[Visual Basic] Overridable Protected Function Sample() As Double [C#] protected virtual double Sample(); [C++] protected: virtual double Sample(); [JScript] protected function Sample() : double;
An 8-byte double-precision number that is greater than or equal to 0.0 and less than 1.0. (0.0 < x < 1.0).
Exception Type | Condition |
---|---|
ArgumentNullException | if value is null. |
When you subclass Random, you can override this method to produce different distributions.