Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for radices other than 10 #236

Open
hakanai opened this issue May 26, 2022 · 0 comments
Open

Support for radices other than 10 #236

hakanai opened this issue May 26, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@hakanai
Copy link

hakanai commented May 26, 2022

Is your feature request related to a problem? Please describe.

The calculator app I've written (not currently using this library, but I'm certainly considering it) currently works in bases 10 and 12, and I'm considering adding support for base 16.

BigDecimal is (as the name says) only for base 10, not allowing me to pass in a radix.

Describe the solution you'd like

A BigNumber class or similar where the radix can be specified would be ideal. BigDecimal could possibly remain as a specialisation of a big number for base 10, but any radix-independent methods could be moved to the superclass.

Describe alternatives you've considered

a. do all the maths in decimal and convert each way. I'd get rounding errors here and there, but it can't be any worse than using double precision.
b. make my own BigRational or BigNumber utilities, possibly building on top of BigInteger.

@ionspin ionspin added the enhancement New feature or request label Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants