Example #1
0
 def test__inplace_divrem1(self):
     # signs are not handled in the helpers!
     for x, y in [(1238585838347L, 3), (1234123412311231L, 1231231), (99, 100)]:
         f1 = rbigint.fromlong(x)
         f2 = y
         remainder = lobj._inplace_divrem1(f1, f1, f2)
         assert (f1.tolong(), remainder) == divmod(x, y)
 def test__inplace_divrem1(self):
     # signs are not handled in the helpers!
     x = 1238585838347L
     y = 3
     f1 = rbigint.fromlong(x)
     f2 = y
     remainder = lobj._inplace_divrem1(f1, f1, f2)
     assert (f1.tolong(), remainder) == divmod(x, y)
Example #3
0
 def test__inplace_divrem1(self):
     # signs are not handled in the helpers!
     x = 1238585838347L
     y = 3
     f1 = rbigint.fromlong(x)
     f2 = y
     remainder = lobj._inplace_divrem1(f1, f1, f2)
     assert (f1.tolong(), remainder) == divmod(x, y)
Example #4
0
 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)
Example #5
0
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)