+ * Create a cryptographically weak pseudo-random number in the interval of 0 to 1.
+ *
+ * @return number between 0 and 1.
+ */
+static double
+weak_random ()
+{
+ return ((double) RANDOM () / RAND_MAX);
+}
+
+
+/**
+ * Produce a random value.
+ *
+ * @param mode desired quality of the random number
+ * @param i the upper limit (exclusive) for the random number