Template:Randnum

From Uncyclopedia, the content-free encyclopedia.

Jump to: navigation, search

Contents

Random number generator

-0.31632346952837

[edit] Usage

[edit] 0-1

Produces a real number between 0 and 1

{{Randnum}}

or

{{Randnum|c}}

where c is an integer greater or equal to zero and less than 46684427. If this template is used several times with the same integer, then it will produce the same number.

[edit] Range

Produces a integer number in a range

{{Randnum||min|max}}

or

{{Randnum|c|min|max}}

where min is the lower bound and max is the upper bound

[edit] Examples

  • {{Randnum}}
    • -0.31632346952837
  • {{Randnum|1}}
    • -0.785437761789
  • {{Randnum|1}}
    • -0.785437761789
  • {{Randnum|2}}
    • -0.25455205404962
  • {{Randnum||10|20}}
    • 7
  • {{Randnum|1|10|20}}
    • 2

[edit] Notes

  • In order to avoid syntax errors, put in the c value!
  • This template is able to defeat the page cache using the random selection feature (the choose tags).
  • The source of randomness is based on the number of articles, pages, files, registered users and admins, and the time (to the second).
  • This is suitable for use in parser functions
    • eg: -5 + -0 = -5

[edit] Math

http://en.wikipedia.org/wiki/Linear_congruential_generator

seed: 20090706180253 mod 1000000+83049-24450+272176-1443686+62

=-932596
Personal tools
projects