Advertisement
Guest User

Untitled

a guest
Oct 13th, 2015
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1. static class RandomExtension
  2.     {
  3.         public static double NextDouble(this Random r, int min, int max)
  4.         {
  5.             //return min + r.NextDouble() * (max - min);
  6.             return r.Next(min + 1, max) - r.NextDouble();
  7.         }
  8.  
  9.         public static double NextDouble(this Random r, double max)
  10.         {
  11.             return r.NextDouble() * max;
  12.         }
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement