Skip to main content

conversion of ints and rationals to any base

Project description


Conversion of a rational number to a representation in any base. Any rational number can be represented as a repeating sequence in any base. Any integer is representable as a terminating sequence in any base.


This facility does not seem to exist in standard Python numerical packages or standard Python symbolic computation packages. Most likely that is because it falls between the two, as it is precise numerical computation, but involves a symbolic component, the possibly repeating sequence of digits.

Algorithmic Complexity

The complexity of operations that perform division in an arbitrary base can be quite high. Most methods are annotated with an estimate of their expected complexity in terms of the number of Python operations that they make use of. No differentiation is made among different Python operations. With respect to division in an arbitrary base, the complexity is bounded by the value of the divisor, unless a precision limit is set.


Downstream packagers, if incorporating testing into their packaging, are encouraged to use only the tests in the test_deterministic module, to avoid testing failures that may arise due to the non-deterministic behavior of Hypothesis tests.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for justbases, version 0.15
Filename, size File type Python version Upload date Hashes
Filename, size justbases-0.15-py3-none-any.whl (29.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size justbases-0.15.tar.gz (37.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page