DrawRandomDouble operation

Fully qualified name: Std.Random.DrawRandomDouble

operation DrawRandomDouble(min : Double, max : Double) : Double

Summary

Draws a random real number from a uniform distribution in a given inclusive interval. Fails if max < min.

Input

min

The smallest real number to be drawn.

max

The largest real number to be drawn.

Output

A random real number in the inclusive interval from min to max with uniform probability.

Example

The following Q# snippet randomly draws an angle between 0 and 2π:

let angle = DrawRandomDouble(0.0, 2.0 * PI());