summaryrefslogtreecommitdiff
path: root/src/MSL_C.PPCEABI.bare.H/rand.c
blob: 9d02257e8e101c1d83236f682b3b16120aeb54b4 (plain)
1
2
3
4
5
6
7
8
9
10
#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; }