repo.or.cz
/
mono-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[llvm] Avoid generating invalid IL for valuetypes+vphi+volatile variables in gsharedv...
[mono-project.git]
/
mono
/
tests
/
random.cs
blob
004046c97658f1430c8eb7c558f12c98b1d6214e
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
}