#include "rand.h"
|
|
RAND (uint64_t seed=0) |
|
uint32_t |
draw (uint32_t max) |
|
uint32_t |
draw (uint32_t min, uint32_t max) |
|
uint32_t |
count (void) |
|
|
RAND (uint64_t seed=0) |
|
uint32_t |
draw (uint32_t max) |
|
uint32_t |
draw (uint32_t min, uint32_t max) |
|
RAND() [1/2]
RAND::RAND |
( |
uint64_t |
seed = 0 |
) |
|
|
inline
|
48 : seed (seed | 1), num (0)
RAND() [2/2]
RAND::RAND |
( |
uint64_t |
seed = 0 |
) |
|
|
inline
|
count()
uint32_t RAND::count |
( |
void |
|
) |
|
|
inline
|
draw() [1/4]
uint32_t RAND::draw |
( |
uint32_t |
max
|
) |
|
|
inline
|
- Examples
- cpp50Example_main.cpp.
58if (max >= 0X7FFFFFFFFFFFFFFFULL)
67 uint64_t frac = 0X7FFFFFFFFFFFFFFFULL / (max + 1ULL);
70 val = (next () >> 1) / frac;
Referenced by draw().
draw() [2/4]
uint32_t RAND::draw |
( |
uint32_t |
max
|
) |
|
|
inline
|
56if (max >= 0X7FFFFFFFUL)
65 uint32_t frac = 0X7FFFFFFFUL / (max + 1UL);
68 val = (next () >> 1) / frac;
draw() [3/4]
uint32_t RAND::draw |
( |
uint32_t |
min, |
|
|
uint32_t |
max |
|
) |
|
|
|
inline
|
83return draw (max - min) + min;
References draw().
draw() [4/4]
uint32_t RAND::draw |
( |
uint32_t |
min, |
|
|
uint32_t |
max |
|
) |
|
|
|
inline
|
81return draw (max - min) + min;
References draw().
The documentation for this class was generated from the following file: