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 details)

Uploaded Source

File details

Details for the file rounding-0.02.tar.gz.

File metadata

  • Download URL: rounding-0.02.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rounding-0.02.tar.gz
Algorithm Hash digest
SHA256 6e578341cbb9bdbc85369d671bcc63ad3c384a2793833f9d9a73203a69764ac1
MD5 0d150190d374946578e2ab8b11e92f33
BLAKE2b-256 256dda72f7916728c0c534f8604f363d21828fccf9a6745f2112c7109559a26c

See more details on using hashes here.

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