Skip to content

Commit

Permalink
Moving declaration inside inner scope
Browse files Browse the repository at this point in the history
  • Loading branch information
mina-asham committed May 17, 2015
1 parent 1a8469b commit 24c155e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions algs4/stdlib/StdRandom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ public static bool Bernoulli()
public static double Gaussian()
{
// use the polar form of the Box-Muller transform
double r, x, y;
double r, x;
do
{
x = Uniform(-1.0, 1.0);
y = Uniform(-1.0, 1.0);
double y = Uniform(-1.0, 1.0);
r = x * x + y * y;
} while (r >= 1 || Math.Abs(r) < double.Epsilon);

Expand Down

0 comments on commit 24c155e

Please sign in to comment.