Changeset 886 for cpp/common/random.h


Ignore:
Timestamp:
07/22/19 01:13:09 (5 years ago)
Author:
Maciej Komosinski
Message:

LONGLONG no longer needed as long as int64_t became standard

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/random.h

    r867 r886  
    99#endif
    1010
    11 #include "nonstd.h" //LONGLONG
    1211#include <time.h> //time()
    1312#include <stdint.h> //uintptr_t
     
    8382                {
    8483                        counter++;
    85                         seed = time(NULL);                         //time (seconds); could use hi-res timer but then we would depend on common/timer.h
     84                        seed = (unsigned int)time(NULL);                         //time (seconds); could use hi-res timer but then we would depend on common/timer.h
    8685                        seed ^= counter;                           //incremented value, possibly randomly initialized
    8786                        seed ^= (unsigned int)(uintptr_t)&counter; //memory address
     
    122121        inline double getDouble() // [0,1)
    123122        {
    124                 return double(getUint32()) / ((LONGLONG)(MAXVALUE)+1);
     123                return double(getUint32()) / ((int64_t)(MAXVALUE)+1);
    125124        }
    126125
Note: See TracChangeset for help on using the changeset viewer.