baseconvert icon indicating copy to clipboard operation
baseconvert copied to clipboard

Feature request: guaranteed exact result

Open mdpkh opened this issue 4 years ago • 0 comments

Since this module only deals in rational numbers, and positional representation of all rational numbers either terminate or repeat with a finite period, it ought to be possible to specify an argument like exact=True which forces the base convert routine to generate as many digits as necessary to return a mathematically correct result. This will require either changing how repeating digits are found (integrating that process into fractional_base()), or generating at least max_period * min_repeat (where max_period can be calculated from the input base, the number of nonrepeating fractional digits of input, and the number of repeating fractional digits of input) before find_recurring() is called.

mdpkh avatar Apr 12 '20 09:04 mdpkh