Changeset 886 for cpp/common/random.h
- Timestamp:
- 07/22/19 01:13:09 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/random.h
r867 r886 9 9 #endif 10 10 11 #include "nonstd.h" //LONGLONG12 11 #include <time.h> //time() 13 12 #include <stdint.h> //uintptr_t … … 83 82 { 84 83 counter++; 85 seed = time(NULL); //time (seconds); could use hi-res timer but then we would depend on common/timer.h84 seed = (unsigned int)time(NULL); //time (seconds); could use hi-res timer but then we would depend on common/timer.h 86 85 seed ^= counter; //incremented value, possibly randomly initialized 87 86 seed ^= (unsigned int)(uintptr_t)&counter; //memory address … … 122 121 inline double getDouble() // [0,1) 123 122 { 124 return double(getUint32()) / (( LONGLONG)(MAXVALUE)+1);123 return double(getUint32()) / ((int64_t)(MAXVALUE)+1); 125 124 } 126 125
Note: See TracChangeset
for help on using the changeset viewer.