Skip to main content

Generate multi-precision pseudo-random number package in python.

Project description

pure_prng

PyPI PyPI - Status GitHub Release Date Language grade: Python Codacy Badge PyPI - Downloads PyPI - Python Version PyPI - License

Generate multi-precision pseudo-random number package in python.

Xoshiro256++ algorithm has been completed.

There are "methods" that specify the period of a multi-precision pseudo-random sequence.

Installation

Installation can be done through pip. You must have python version >= 3.7

pip install pure-prng

Usage

The statement to import the package:

from pure_prng_package import pure_prng

Example:

>>> seed = 170141183460469231731687303715884105727
>>> period = 115792089237316195423570985008687907853269984665640564039457584007913129639747

>>> prng_instance = pure_prng(seed)

>>> prng_instance.source_random_number()
73260932800743358445652462028207907455677987852735468159219395093090100006110

>>> prng_instance.rand_float()
mpfr('0.6326937641706669741872583730940429737405414921354622618051716414693676562568086',257)
>>> prng_instance.rand_float(period)
mpfr('0.02795744845257346733436109648463446736744766610965612207643215290679786849298934',256)

>>> prng_instance.rand_int(100, 1)
mpz(94)
>>> prng_instance.rand_int(100, 1, period)
mpz(38)

>>> prng_instance.get_randint_set(100, 1, 6)
{mpz(98), mpz(68), mpz(46), mpz(24), mpz(27), mpz(94)}

>>> prng_instance.rand_with_period(period)
40688839126177430252467309162469901643963863918059158449302074429100738061310

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

pure_prng-0.8.2.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

pure_prng-0.8.2-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file pure_prng-0.8.2.tar.gz.

File metadata

  • Download URL: pure_prng-0.8.2.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.0

File hashes

Hashes for pure_prng-0.8.2.tar.gz
Algorithm Hash digest
SHA256 679ab5ec23a2ed844c9e014164cfda54146544f421ee90ab63ce01c271d8a6bd
MD5 a33e51e100ac56ec3242c93e3ffe420b
BLAKE2b-256 0cddbb9501ca208d3c7f49f34bc373bea4c2262db36d2cae1cc09c6518e20bd3

See more details on using hashes here.

File details

Details for the file pure_prng-0.8.2-py3-none-any.whl.

File metadata

  • Download URL: pure_prng-0.8.2-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.0

File hashes

Hashes for pure_prng-0.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2cb562fb268efe26fb2caa57b0a9c75e0f850cf0cccda9091a70d85d3ab714ce
MD5 57eb5a6b68f08bc1d59cd2a0ad39fca8
BLAKE2b-256 17f43f917d10ad204fb54984942a1ffcce5a2c281ffeba6415fe82b2238ca283

See more details on using hashes here.

Supported by

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