ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/random.h
(Generate patch)

Comparing ray/src/common/random.h (file contents):
Revision 2.16 by greg, Wed Apr 5 06:22:56 2006 UTC vs.
Revision 2.18 by greg, Sat Apr 9 15:39:16 2011 UTC

# Line 17 | Line 17 | extern "C" {
17   #endif
18   #define srandom(s)      srand((unsigned)(s))
19  
20 < #define frandom()       (rand()*(1./RAND_MAX))
20 > #define frandom()       (rand()*(1./(RAND_MAX+.5)))
21  
22   #else
23   #ifdef  BSD
# Line 41 | Line 41 | extern double  drand48();
41   extern unsigned short   *urperm;
42   extern int      urmask;
43  
44 < #define  urand(i)       (urmask ? ((urperm[(i)&urmask]+frandom())/(urmask+1)) \
44 > #define  urand(i)       (urmask ? (urperm[(i)&urmask]+frandom())/(urmask+1) \
45                                  : frandom())
46  
47   extern int      initurand(int size);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines