Commit 29b7ebe
committed
don't generate biased prime numbers
since the current algorithm selects a number and then goes up, primes
for which the previous prime is far away are more likely to be selected,
similarly the bigger of the twin primes is less likely to be selected
make the prime selection a little bit more uniform by just modifying
the randomly selecting number to be odd, if an even is selected1 parent d59ac46 commit 29b7ebe
1 file changed
+9
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
400 | 399 | | |
401 | 400 | | |
402 | 401 | | |
| |||
0 commit comments