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

Enable Numbers of length() greater than base_. #184

Open
matt-gretton-dann opened this issue May 23, 2021 · 0 comments
Open

Enable Numbers of length() greater than base_. #184

matt-gretton-dann opened this issue May 23, 2021 · 0 comments
Labels

Comments

@matt-gretton-dann
Copy link
Owner

The bc length() function returns the length of a number in terms of the number of digits.

The current implementation assumes that this will fit in NumType and so be less than the base of
numbers we are storing. This is surprisingly limiting (esp. if NumType is 8- or 16-bits).

We should update this so that the maximum length is either:

  • base_ * base_log10_: That is you can have at most base_ underlying digits in the number
    array; or
  • std::vector<>::max_size() * base_log10_: You can have Numbers as long as you like.

Assignees: @matt-gretton-dann
Labels: bc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant