prime/src/Runtime/rand.c
Luke Street 00c77e6195 Runtime/math matches; better libc headers
Former-commit-id: bef7db17486213f77de865dfbec529ae23b394a4
2022-08-25 23:46:24 -04:00

11 lines
192 B
C

#include <stdlib.h>
static unsigned long int next = 1;
int rand(void) {
next = next * 1103515245 + 12345;
return (next >> 16) & 0x7FFF;
}
void srand(unsigned int seed) { next = seed; }