File: PenroseRand.c

package info (click to toggle)
pd-fftease 2.5.2.git20121005-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 1,120 kB
  • sloc: ansic: 17,044; makefile: 376; perl: 80
file content (13 lines) | stat: -rw-r--r-- 274 bytes parent folder | download | duplicates (5)
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.);
}