ThreadLocalRandom.NextDouble Method

Definition

Overloads

NextDouble(Double)

Returns a pseudorandom double value between 0.

NextDouble(Double, Double)

Returns a pseudorandom double value between the specified origin (inclusive) and bound (exclusive).

NextDouble(Double)

Returns a pseudorandom double value between 0.

[Android.Runtime.Register("nextDouble", "(D)D", "GetNextDouble_DHandler")]
public virtual double NextDouble (double bound);
[<Android.Runtime.Register("nextDouble", "(D)D", "GetNextDouble_DHandler")>]
override this.NextDouble : double -> double

Parameters

bound
Double

the upper bound (exclusive). Must be positive.

Returns

a pseudorandom double value between zero (inclusive) and the bound (exclusive)

Attributes

Exceptions

if n is not positive

Remarks

Returns a pseudorandom double value between 0.0 (inclusive) and the specified bound (exclusive).

Java documentation for java.util.concurrent.ThreadLocalRandom.nextDouble(double).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

NextDouble(Double, Double)

Returns a pseudorandom double value between the specified origin (inclusive) and bound (exclusive).

[Android.Runtime.Register("nextDouble", "(DD)D", "GetNextDouble_DDHandler")]
public virtual double NextDouble (double origin, double bound);
[<Android.Runtime.Register("nextDouble", "(DD)D", "GetNextDouble_DDHandler")>]
override this.NextDouble : double * double -> double

Parameters

origin
Double

the least value returned

bound
Double

the upper bound (exclusive)

Returns

a pseudorandom double value between the origin (inclusive) and the bound (exclusive)

Attributes

Exceptions

if least greater than or equal to bound

Remarks

Returns a pseudorandom double value between the specified origin (inclusive) and bound (exclusive).

Java documentation for java.util.concurrent.ThreadLocalRandom.nextDouble(double, double).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to