Skip to content

C extension for CPython implementing termial random

License

Notifications You must be signed in to change notification settings

thoth-station/termial-random

Repository files navigation

Implementation of termial random

This minimalistic CPython extension provides termial random implementation.

See this article for more info on termial random.

Basically, the random generator prioritizes numbers closer to 0. See the distribution plotted below for n==10.

Distribution of numbers generated using termial random.

Installation

Simply install this library using pip:

pip install termial-random

Usage

The module provides 3 core routines:

  • termial_random.seed(n) used to initialie glibc random number generator based on n provided
  • termial_random.seed_init() used to initialie glibc random number generator based on the current time
  • termial_random.random(n) used to compute termial random number for the given n

Benchmarks

See this gist with benchmarks.

About

C extension for CPython implementing termial random

Resources

License

Stars

Watchers

Forks

Packages

No packages published