1 #ifndef BZ_MATH_RANDOM_H
2 #define BZ_MATH_RANDOM_H
4 #include <bz/types/common.h>
10 extern float bzRandomFloat(float max);
11 extern float bzRandomFloatRange(float v1, float v2);
12 extern uint32_t bzRandomInteger(uint32_t max);
13 extern int32_t bzRandomIntegerRange(int32_t v1, int32_t v2);
14 extern void *bzRandomArrayValue(size_t count, size_t arrayTypeSize, void *array);
15 //extern void *bzRandomArrayValue(pcg32_random_t *rng, size_t count, size_t arrayTypeSize, void *array);
17 #define bzRandom(T, ...) (*((T *)bzRandomArrayValue(sizeof((T[]){__VA_ARGS__})/sizeof(T), sizeof(T), (T[]){__VA_ARGS__})))