Testing sandbox version compared to main version

edit
Clic purge to get new ouputs.
Code Result with sandbox template Result with main template Note
{{Random number}} 70 53 default parameters (results range is 0..99)
{{Random number|100|197|67}} 42 (KO) 53 (ok) should be same as above (the default seed depends on current day of year, the default prime is 67)
{{Random number|10000}} 1217 953 new parameters (results range in 0..9999)
{{Random number|10000|197|67}} 2031 (KO) 953 (ok) Should be same as above
{{Random number|10000|197|61}} 1728 8892 (use another prime) this and others should all be different
{{Random number|10000|6}} 3280 8156 (varying the seed) note that the sequence is linear but the distance only depends on the value of the default prime (67)
{{Random number|10000|5}} 7298 8089
{{Random number|10000|4}} 5721 8022
{{Random number|10000|3}} 8716 7955
{{Random number|10000|2}} 2800 7888
{{Random number|10000|1}} 6757 7821
{{Random number|10000|0}} 770 7754
{{Random number|10000|6|2}} 3607 6959 (varying the seed) with a small prime (2) should still get distinct values in the linear sequence
{{Random number|10000|5|2}} 7625 6957
{{Random number|10000|4|2}} 462 6955
{{Random number|10000|3|2}} 7707 6953
{{Random number|10000|2|2}} 544 6951
{{Random number|10000|1|2}} 3381 6949 (varying now the prime number) should get distinct non-linear sequences
{{Random number|10000|1|3}} 2311 5423
{{Random number|10000|1|5}} 3532 2373
{{Random number|10000|1|7}} 6792 9323
{{Random number|10000|1|11}} 478 3224
{{Random number|10000|1|13}} 8904 165
{{Random number|10000|1|17}} 1741 4062
{{Random number|10000|1|19}} 9018 1023
{{Random number|10000|1|23}} 6233 4921
{{Random number|10000|1|29}} 9065 5753
{{Random number|10000|1|31}} 5050 2719
{{Random number|10000|1|37}} 5609 3554
{{Random number|10000|1|41}} 9622 7435
{{Random number|10000|1|43}} 3453 4424
{{Random number|10000|1|47}} 6660 8313
{{Random number|10000|1|51}} 8139 2178
{{Random number|10000|1|53}} 2150 9151
{{Random number|10000|1|59}} 1128 9998
{{Random number|10000|1|61}} 1348 6936
{{Random number|10000|1|67}} 8141 7821
{{Random number|10000|1|71}} 6630 1699
{{Random number|10000|1|73}} 3815 8623
{{Random number|10000|1|79}} 1089 9493

Sandbox notes

edit

This version uses fmod builtin operator (no longer need of Template:Mod) and the largest Mersenne prime (231−1) that fits in 32 bits.

This Mersenne prime is chosen to offer equal distribution when reducing the number of digits (better than bitmasking by an exact power of 2).

The next Mersenne prime (261−1) is too large to fit in 64-bit integers for computing products by reasonable primes (we could only use 2, 3, 5 or 7), or even just in the 52 bits of precision of a double float (used by #expr).