|
|
1.1 ! root 1: #ifndef lint ! 2: static char sccsid[] = "@(#)ranf.c 4.2 (Berkeley) 5/27/83"; ! 3: #endif not lint ! 4: ! 5: # include <stdio.h> ! 6: ! 7: ranf(max) ! 8: int max; ! 9: { ! 10: register int t; ! 11: ! 12: if (max <= 0) ! 13: return (0); ! 14: t = rand() >> 5; ! 15: return (t % max); ! 16: } ! 17: ! 18: ! 19: double franf() ! 20: { ! 21: double t; ! 22: t = rand() & 077777; ! 23: return (t / 32767.0); ! 24: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.