Index: athena-jot-9.0/jot.c
===================================================================
--- athena-jot-9.0.orig/jot.c	2001-05-16 07:19:50.000000000 +0200
+++ athena-jot-9.0/jot.c	2016-03-06 16:45:41.457255048 +0100
@@ -108,13 +108,20 @@
 	register double	*y = &yd;
 	register long	*i = &id;
 
+	int range; 
+	unsigned int randval;
+
 	getargs(argc, argv);
 	if (randomize) {
 		*x = (ender - begin) * (ender > begin ? 1 : -1);
 		srandom((int) s);
+		range = *x + 1;
 		for (*i = 1; *i <= reps || infinity; (*i)++) {
-			*y = (double) random() / INT_MAX;
-			putdata(*y * *x + begin, reps - *i);
+			do {
+				randval = random();
+			} while ( randval > RAND_MAX - (RAND_MAX % range));
+			*y = (double) (randval % range);
+			putdata(*y + begin, reps - *i);
 		}
 	}
 	else
