summaryrefslogtreecommitdiff
path: root/Source/Kernel/Library/Rand.ns.cpp
blob: e568678b53032148b81cfd2762e192fb664b501b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "Rand.ns.h"

namespace Rand {

u32int m = 2073741824, a = 50000, b = 1534;
u64int current = RANDOM_SEED;

u64int rand() {
	current = (u32int)(a*current + b);
	while (current > m) current -= m;
	return current;
}

u64int max() {
	return m;
}

}