def new_biginteger(self, value): # Allocate a new integer and set its class to be the integer class result = BigInteger(self._nilObject, value) result.set_class(self._bigintegerClass) # Return the freshly allocated integer return result
def new_biginteger(self, value): # Allocate a new integer and set its class to be the integer class result = BigInteger(self._nilObject) result.set_class(self._bigintegerClass) # Set the embedded integer of the newly allocated integer result.set_embedded_biginteger(value) # Return the freshly allocated integer return result
class BigIntegerTestCase(unittest.TestCase): def setUp(self): self.big_integer = BigInteger(Object(None), 30000000000) self.integer = Integer(Object(None), 3) def test_get_embedded_biginteger(self): self.assertEqual(30000000000, self.big_integer.get_embedded_biginteger()) def test_get_embedded_value(self): self.assertEqual(30000000000, self.big_integer.get_embedded_value()) def test_get_embedded_value_integer_and_big_integer(self): self.assertEqual(3, self.integer.get_embedded_value()) self.assertEqual(30000000000, self.big_integer.get_embedded_value())
def new_biginteger(value): assert isinstance(value, rbigint) return BigInteger(value)
def setUp(self): self.big_integer = BigInteger(Object(None), 30000000000) self.integer = Integer(Object(None), 3)
def new_biginteger(value): return BigInteger(value)