summaryrefslogtreecommitdiff
path: root/Source/Library/Common/Rand.ns.cpp
blob: 65b450c3b54f40e3d21a237eccbb4bfe67995a42 (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 = 2073741978, a = 50023, b = 1534097;
u64int current = RANDOM_SEED;

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

u64int max() {
	return m;
}

}