示例#1
0
文件: universe.py 项目: Gabri3l/PySOM
    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
示例#2
0
    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
示例#3
0
文件: universe.py 项目: krono/PySOM
    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
示例#4
0
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())
示例#5
0
 def new_biginteger(value):
     assert isinstance(value, rbigint)
     return BigInteger(value)
示例#6
0
 def setUp(self):
     self.big_integer = BigInteger(Object(None), 30000000000)
     self.integer = Integer(Object(None), 3)
示例#7
0
 def new_biginteger(value):
     return BigInteger(value)