X-Git-Url: https://hackdaworld.org/gitweb/?p=physik%2Fnlsop.git;a=blobdiff_plain;f=random.c;h=4d96243786f5aab2fec4d74b42fea35d02736e1f;hp=17cbd73c887e1d5a9656431c5b7465b7f98b9c2a;hb=bff06b2b371ba4a6524a01804600a9ac2b6cb304;hpb=5d5a9a58e9ecb4221b1c41e536b9648500b9b41d diff --git a/random.c b/random.c index 17cbd73..4d96243 100644 --- a/random.c +++ b/random.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "random.h" @@ -62,7 +63,7 @@ u32 get_rand(u32 max) } c_ptr=b_ptr; } - + return((u32)(*(c_ptr++)*(max*1.0/((long long unsigned int)URAND_MAX+1)))); }