|
Veritable Lasagna
An Allocator & Data Structure Library for C.
|
Include dependency graph for vl_rand.c:Macros | |
| #define | VL_IEEE754_FLOAT32_LOW23 0x007FFFFFu |
| #define | VL_IEEE754_FLOAT32_ONE 0x3F800000u |
| #define | VL_IEEE754_FLOAT32_LOW23_DW 0x007FFFFF007FFFFFull |
| #define | VL_IEEE754_FLOAT32_ONE_DW 0x3F8000003F800000ull |
| #define | VL_IEEE754_FLOAT64_LOW52 0x000FFFFFFFFFFFFFull |
| #define | VL_IEEE754_FLOAT64_ONE 0x3FF0000000000000ull |
Functions | |
| vl_rand | vlRandInit () |
| Initializes a random state (aka, seed) based on the current time. | |
| vl_rand | vlRandNext (vl_rand *rand) |
| Returns the "next" 64-bit integer. | |
| void | vlRandFill (vl_rand *rand, void *mem, vl_memsize_t len) |
| vl_float32_t | vlRandF (vl_rand *rand) |
| Generate a random float. | |
| void | vlRandFx2 (vl_rand *rand, vl_float32_t *result) |
| Generates two random floats. | |
| #define VL_IEEE754_FLOAT32_LOW23 0x007FFFFFu |
| #define VL_IEEE754_FLOAT32_LOW23_DW 0x007FFFFF007FFFFFull |
| #define VL_IEEE754_FLOAT32_ONE 0x3F800000u |
| #define VL_IEEE754_FLOAT32_ONE_DW 0x3F8000003F800000ull |
| #define VL_IEEE754_FLOAT64_LOW52 0x000FFFFFFFFFFFFFull |
| #define VL_IEEE754_FLOAT64_ONE 0x3FF0000000000000ull |
| vl_float32_t vlRandF | ( | vl_rand * | randPtr | ) |
Generate a random float.
Range of returned value is in 0...1.
| randPtr | pointer to random state |
Here is the call graph for this function:
Here is the caller graph for this function:| void vlRandFill | ( | vl_rand * | rand, |
| void * | mem, | ||
| vl_memsize_t | len ) |
Here is the call graph for this function:| void vlRandFx2 | ( | vl_rand * | randPtr, |
| vl_float32_t * | resultPtr ) |
Generates two random floats.
Range of returned floats is in range of 0...1.
| randPtr | pointer to random state |
| resultPtr | where the result will be stored |
Here is the call graph for this function:| vl_rand vlRandInit | ( | ) |
Initializes a random state (aka, seed) based on the current time.
This function can be skipped entirely, assuming another seed integer can be provided.
Here is the call graph for this function: