Skip to main content

Stochastic Rounding

Project description

Stochastic rounding provides a mechanism to eliminate accumulated roundoff error in the presence of a distribution where for individual samples, the roundoff error is skewed. This is typically caused by small values.

One drawback to stochastic rounding is the output is non-deterministic, but this can be avoided by providing a custom deterministic generator, or invoking providing the random number generator with a fixed seed.

r = random.Random()
r.seed(123)
sr = StochasticRound(precision=0, random_generator=r)

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

rounding-0.02.tar.gz (1.9 kB view hashes)

Uploaded Source

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