]> hackdaworld.org Git - physik/nlsop.git/blobdiff - random.c
new TODO
[physik/nlsop.git] / random.c
index 17cbd73c887e1d5a9656431c5b7465b7f98b9c2a..6690531bc9ec919390e7bc72c603d81a1fb3e0fc 100644 (file)
--- a/random.c
+++ b/random.c
@@ -9,6 +9,8 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <stdlib.h>
+#include <math.h>
 
 #include "random.h"
 
@@ -62,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))));
 }