Generate multi-precision pseudo-random number package in python.
Project description
Pure_PRNG
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.8
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
Release history Release notifications | RSS feed
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.4.tar.gz
(6.2 kB
view details)
Built Distribution
pure_prng-0.8.4-py3-none-any.whl
(19.0 kB
view details)
File details
Details for the file pure_prng-0.8.4.tar.gz
.
File metadata
- Download URL: pure_prng-0.8.4.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3521f6d211a64b4e188bd36f444a42c85ecfa58e8a8bfa2a2e78337bf00fd9a5 |
|
MD5 | a773e4bb6091ed9b7f785a86d897597a |
|
BLAKE2b-256 | 411e902b4d807d9010578dbd7642c6e787bea3086e7c503eeaae3f453351b818 |
File details
Details for the file pure_prng-0.8.4-py3-none-any.whl
.
File metadata
- Download URL: pure_prng-0.8.4-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aff7bf381354b5e9d2409d7ef99f843056f3fef88df5963186339832b45bc4b4 |
|
MD5 | 9bfe17a4007e0343b26d25ca0a6b34b7 |
|
BLAKE2b-256 | 4def0db5c59e76fa2ec0f83f8b626e24778b4d895faf4aa027c680a30e56668e |