Merge pull request #5390 from kumpera/fix_58637
[mono.git] / mono / tests / random.cs
1
2 public class GenRandom {
3         static int last = 42;
4
5         public static double gen_random(double max) {
6     
7             last = (last * 3877 + 29573) % 139968;
8         return( max * last / 139968 );
9         }
10
11         public static int Main() {
12         int N = 900000;
13             double result = 0;
14     
15         while (N-- != 0) {
16                         result = gen_random(100.0);
17         }
18             //printf("%.9f\n", result);
19         return(0);
20         }
21 }