[go: up one dir, main page]

File: gwrand.c

package info (click to toggle)
circlepack 5.1-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny, sarge
  • size: 2,828 kB
  • ctags: 1,683
  • sloc: ansic: 43,152; makefile: 46
file content (16 lines) | stat: -rw-r--r-- 359 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "cp_types.h"
#include "cp_proto.h"

/* Brock Williams random number generator. Gives pseudo-random 
number between -1 and 1 */

extern unsigned long int rand_next;

double gwrand()
{
  unsigned int tmp;

  rand_next=rand_next*1103515245 + 12345;
  tmp=(unsigned int)(rand_next/65536) % 32768;
  return (double)(((double)tmp)/32768.0);
} /* gwrand */