Internally, BigInt finds division and modulo with the divModInternal function. This functionality should be exposed to the user as a divMod function (naming from Python) so both operations can be done at once.
An example of where this would be useful is when rounding a BigInt to a certain number of digits, you have to divide by ten, but also keep track of what the last digit was in order to know if you should increase the final result by one.
Comment #1 by github-bugzilla — 2018-01-30T15:52:56Z
Comment #2 by paul.d.anderson — 2018-02-09T22:25:09Z
I get an access error when calling this function using v2.078.1-master-419f135.
Looking at the code, it seems like the function was never made public, hence the error.
Is this an oversight or am I mistaken?
Paul
Comment #3 by greensunny12 — 2018-02-10T00:20:46Z
Works fine for me:
https://run.dlang.io/is/r07zHf
(setting this to RESOLVED FIXED as the PR has been merged)
Are you sure you are using nightly?
Comment #4 by paul.d.anderson — 2018-02-10T22:10:23Z
(In reply to Seb from comment #3)
> Works fine for me:
>
> https://run.dlang.io/is/r07zHf
>
> (setting this to RESOLVED FIXED as the PR has been merged)
>
> Are you sure you are using nightly?
Sorry, my mistake.