fixed type & increased MAX_CHAR size
[physik/nlsop.git] / random.c
index 6694317..6690531 100644 (file)
--- a/random.c
+++ b/random.c
@@ -10,6 +10,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <math.h>
 
 #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))));
 }