ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/random.h
Revision: 1.4
Committed: Fri May 17 13:51:29 1991 UTC (32 years, 11 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 1.3: +6 -1 lines
Log Message:
added urand() definition

File Contents

# User Rev Content
1 greg 1.1 /* Copyright (c) 1986 Regents of the University of California */
2    
3     /* SCCSid "$SunId$ LBL" */
4    
5     /*
6 greg 1.4 * random.h - header file for random(3) and urand() function.
7 greg 1.1 *
8     * 10/1/85
9     */
10    
11 greg 1.3 #ifdef BSD
12    
13 greg 1.1 extern long random();
14    
15 greg 1.2 #define frandom() (random()*(1./2147483648.))
16 greg 1.3
17     #else
18    
19     extern long lrand48();
20     extern double drand48();
21    
22     #define random() lrand48()
23     #define frandom() drand48()
24    
25     #endif
26 greg 1.4
27     #define urand(i) ((urperm[(i)&urmask]+frandom())/(urmask+1))
28    
29     extern short *urperm;
30     extern int urmask;