Skip to content

Commit

Permalink
Divide by const, not RAND_MAX
Browse files Browse the repository at this point in the history
  • Loading branch information
swenson committed Feb 13, 2024
1 parent 2d12a3f commit 7de9205
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stresstest.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#define TESTS 1000

#define RAND_RANGE(__n, __min, __max) \
(__n) = (__min) + (long) ((double) ( (double) (__max) - (__min) + 1.0) * ((__n) / (RAND_MAX + 1.0)))
(__n) = (__min) + (long) ((double) ( (double) (__max) - (__min) + 1.0) * ((__n) / (0x7fffffff + 1.0)))

enum {
FILL_RANDOM,
Expand Down

0 comments on commit 7de9205

Please sign in to comment.