X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=random.c;h=6690531bc9ec919390e7bc72c603d81a1fb3e0fc;hb=a3957b19b4696cb5f7e3204567dac942bf5b6a21;hp=66943173da8d8bcc55b8ef190b57bd18df7efa59;hpb=ac3628afff01679dfa9da69cf010764970e40be7;p=physik%2Fnlsop.git diff --git a/random.c b/random.c index 6694317..6690531 100644 --- a/random.c +++ b/random.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "random.h" @@ -63,7 +64,7 @@ u32 get_rand(u32 max) } c_ptr=b_ptr; } - + return((u32)(*(c_ptr++)*(max*1.0/((long long unsigned int)URAND_MAX+1)))); }