[Issue 18086] New: BigInt DivMod

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 15 22:04:42 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=18086

          Issue ID: 18086
           Summary: BigInt DivMod
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: jack at jackstouffer.com

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.

--


More information about the Digitalmars-d-bugs mailing list