aboutsummaryrefslogtreecommitdiff
path: root/PenroseRand.c
blob: 98f396e6d580ac0106776de3d420715fdb0a1070 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "PenroseRand.h"

float rrand(int *seed)
{
    int i = ((*seed = *seed * 1103515245 + 12345)>>16) & 077777;
    return((float)i/16384. - 1.);
}

float prand(int *seed)
{
    int i = ((*seed = *seed * 1103515245 + 12345)>>16) & 077777;
    return((float)i/32768.);
}