`divMod` was added to std.bigint. $(REF divMod, std, bigint) calculates both the quotient and the remainder in one go: ----- void divMod(const BigInt dividend, const BigInt divisor, out BigInt quotient, out BigInt remainder) pure nothrow { auto a = BigInt(123); auto b = BigInt(25); BigInt q, r; divMod(a, b, q, r); assert(q == 4); assert(r == 23); assert(q * b + r == a); } -----