Template:Random number/testcases
Jump to navigation
Jump to search
This is the template test cases page for the sandbox of Template:Random number. to update the examples. If there are many examples of a complicated template, later ones may break due to limits in MediaWiki; see the HTML comment "NewPP limit report" in the rendered page. You can also use Special:ExpandTemplates to examine the results of template uses. You can test how this page looks in the different skins with these links: |
Testing sandbox version compared to main version
Code | Result with sandbox template | Result with main template | Note |
---|---|---|---|
{{Random number}} |
Template:Random number/sandbox | 22 | default parameters (results range is 0..99) |
{{Random number|100|290|67}}
|
Template:Random number/sandbox (ok) | 22 (ok) | should be same as above (the default seed depends on current day of year, the default prime is 67) |
{{Random number|10000}} |
Template:Random number/sandbox | 6622 | new parameters (results range in 0..9999) |
{{Random number|10000|290|67}}
|
Template:Random number/sandbox (ok) | 6622 (ok) | Should be same as above |
{{Random number|10000|290|61}}
|
Template:Random number/sandbox | 9462 | (use another prime) this and others should all be different |
{{Random number|10000|6}} |
Template:Random number/sandbox | 7594 | (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}} |
Template:Random number/sandbox | 7527 | |
{{Random number|10000|4}} |
Template:Random number/sandbox | 7460 | |
{{Random number|10000|3}} |
Template:Random number/sandbox | 7393 | |
{{Random number|10000|2}} |
Template:Random number/sandbox | 7326 | |
{{Random number|10000|1}} |
Template:Random number/sandbox | 7259 | |
{{Random number|10000|0}} |
Template:Random number/sandbox | 7192 | |
{{Random number|10000|6|2}} |
Template:Random number/sandbox | 5152 | (varying the seed) with a small prime (2) should still get distinct values in the linear sequence |
{{Random number|10000|5|2}} |
Template:Random number/sandbox | 5150 | |
{{Random number|10000|4|2}} |
Template:Random number/sandbox | 5148 | |
{{Random number|10000|3|2}} |
Template:Random number/sandbox | 5146 | |
{{Random number|10000|2|2}} |
Template:Random number/sandbox | 5144 | |
{{Random number|10000|1|2}} |
Template:Random number/sandbox | 5142 | (varying now the prime number) should get distinct non-linear sequences |
{{Random number|10000|1|3}} |
Template:Random number/sandbox | 2715 | |
{{Random number|10000|1|5}} |
Template:Random number/sandbox | 7857 | |
{{Random number|10000|1|7}} |
Template:Random number/sandbox | 2999 | |
{{Random number|10000|1|11}} |
Template:Random number/sandbox | 3283 | |
{{Random number|10000|1|13}} |
Template:Random number/sandbox | 8425 | |
{{Random number|10000|1|17}} |
Template:Random number/sandbox | 8709 | |
{{Random number|10000|1|19}} |
Template:Random number/sandbox | 3851 | |
{{Random number|10000|1|23}} |
Template:Random number/sandbox | 4135 | |
{{Random number|10000|1|29}} |
Template:Random number/sandbox | 9561 | |
{{Random number|10000|1|31}} |
Template:Random number/sandbox | 4703 | |
{{Random number|10000|1|37}} |
Template:Random number/sandbox | 129 | |
{{Random number|10000|1|41}} |
Template:Random number/sandbox | 413 | |
{{Random number|10000|1|43}} |
Template:Random number/sandbox | 5555 | |
{{Random number|10000|1|47}} |
Template:Random number/sandbox | 5839 | |
{{Random number|10000|1|51}} |
Template:Random number/sandbox | 6123 | |
{{Random number|10000|1|53}} |
Template:Random number/sandbox | 1265 | |
{{Random number|10000|1|59}} |
Template:Random number/sandbox | 6691 | |
{{Random number|10000|1|61}} |
Template:Random number/sandbox | 1833 | |
{{Random number|10000|1|67}} |
Template:Random number/sandbox | 7259 | |
{{Random number|10000|1|71}} |
Template:Random number/sandbox | 7543 | |
{{Random number|10000|1|73}} |
Template:Random number/sandbox | 2685 | |
{{Random number|10000|1|79}} |
Template:Random number/sandbox | 8111 |
Sandbox notes
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).