Skip to main content

A package providing a fraction-based Real class that allows you to do exact real arithmetic, along with some algorithms

Project description

This is a Python package to do exact real arithmetic, the following is an example using it:

from precreal import Real,intpow,pi

>>> 0.1+0.2==0.3 # Precision loss

False

>>> Real("0.1")+Real("0.2")==Real("0.3") # The Real class has NO precision loss when doing arithmetic

True

>>> intpow(Real(2),100)

1267650600228229401496703205376

>>> pi(7)
3.1415926

You can also run precreal_test, which tests three features of this package.

changelog:

  • 1.0.0 First version
  • 1.0.1 Fixed a setup.py bug
  • 1.0.2 Fixed the bug that pi computing results in 10 more digits

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

precreal-1.0.2.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

precreal-1.0.2-py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 3

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