Skip to main content

Contains implementations of Random Number Generators

Project description

gregs_rng

A package for generating random numbers using various methods. The current version only supports the Linear Congruential Method.

Linear Congruential Generator:

Thompson, W. E. (1958). A Modified Congruence Method of Generating Pseudo-Random Numbers. The Computer Journal, 1(2), 83–88. https://academic.oup.com/comjnl/article-abstract/1/2/83/425243 Rotenberg, A. (1960). A New Pseudo-Random Number Generator. Journal of the ACM, 7(1), 75–77. https://dl.acm.org/doi/10.1145/321008.321019 https://en.wikipedia.org/wiki/Linear_congruential_generator

Choice of parameters for LCG:

Donald E. Knuth (1981). The Art of Computer Programming, Volume 2: Seminumerical Algorithms (2nd ed.). Addison-Wesley. https://en.wikipedia.org/wiki/The_Art_of_Computer_Programming

Press, W. H., Teukolsky, S. A., Vetterling, W. T., & Flannery, B. P. Numerical Recipes in C: The Art of Scientific Computing, 2nd ed., Cambridge University Press, 1992. https://en.wikipedia.org/wiki/Numerical_Recipes

Install:

pip install gregs_rng

Import and Use:

from gregs_rng import lcg

g = lcg(42)
print(next(g))
print(next(g))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gregs_rng-0.1.10.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gregs_rng-0.1.10-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file gregs_rng-0.1.10.tar.gz.

File metadata

  • Download URL: gregs_rng-0.1.10.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gregs_rng-0.1.10.tar.gz
Algorithm Hash digest
SHA256 f8f1cae007d73c5362995b0e7ed18ac2e668dc4c48a67ab7ee4980534d181aae
MD5 ebed93ecf514a549f2f00a7cf607aeee
BLAKE2b-256 f1b02aab1004320f9921f5fc50f7195470846b86e6692ee471c6048c3758c217

See more details on using hashes here.

Provenance

The following attestation bundles were made for gregs_rng-0.1.10.tar.gz:

Publisher: pypi.yml on gregdorshimer/gregs_rng

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gregs_rng-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: gregs_rng-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gregs_rng-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 df8d0af545751d40396f4b9ec4605992077bf6ecdfc9ccc3b9a68a6f901ec3cf
MD5 7c97df610431d2ecb0a0bdedd02a1312
BLAKE2b-256 bb9115d51a63151d15b907f9b2e6c5ee9682363c640b3a5e75dfa88fd7f8dd29

See more details on using hashes here.

Provenance

The following attestation bundles were made for gregs_rng-0.1.10-py3-none-any.whl:

Publisher: pypi.yml on gregdorshimer/gregs_rng

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page