def test__inplace_divrem1(self): # signs are not handled in the helpers! for x, y in [(1238585838347L, 3), (1234123412311231L, 1231231), (99, 100)]: if y > MASK: continue f1 = rbigint.fromlong(x) f2 = y remainder = lobj._inplace_divrem1(f1, f1, f2) assert (f1.tolong(), remainder) == divmod(x, y)
class TestInternalFunctions(object): def test__inplace_divrem1(self): # signs are not handled in the helpers! for x, y in [(1238585838347L, 3), (1234123412311231L, 1231231), (99, 100)]: if y > MASK: continue f1 = rbigint.fromlong(x) f2 = y remainder = lobj._inplace_divrem1(f1, f1, f2) assert (f1.tolong(), remainder) == divmod(x, y) out = bigint([99, 99], 1) remainder = lobj._inplace_divrem1(out, out, 100)