]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/random.h
Random: Implemented fastrand_double().
[libucw.git] / ucw / random.h
index 703b1b09a7660bc5002359122123a7ac9d048ca1..0a287d189f7885486f17b6b5f27c869b13a54ee7 100644 (file)
@@ -24,6 +24,7 @@
 #define fastrand_max ucw_fastrand_max
 #define fastrand_max_u64 ucw_fastrand_max_u64
 #define fastrand_mem ucw_fastrand_mem
+#define fastrand_double ucw_fastrand_double
 #endif
 
 /* random-fast.c */
@@ -94,4 +95,7 @@ u64 fastrand_max_u64(struct fastrand *c, u64 bound);
 /** Generate @size random bytes. **/
 void fastrand_mem(struct fastrand *c, void *ptr, size_t size);
 
+/** Uniformly generate a random number from range [0.0, 1.0) + possible inaccuracies from basic floating point operations. **/
+double fastrand_double(struct fastrand *c);
+
 #endif