当前位置: 首页>>代码示例>>Python>>正文


Python IntObject.call方法代码示例

本文整理汇总了Python中typhon.objects.data.IntObject.call方法的典型用法代码示例。如果您正苦于以下问题:Python IntObject.call方法的具体用法?Python IntObject.call怎么用?Python IntObject.call使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在typhon.objects.data.IntObject的用法示例。


在下文中一共展示了IntObject.call方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testMulDouble

# 需要导入模块: from typhon.objects.data import IntObject [as 别名]
# 或者: from typhon.objects.data.IntObject import call [as 别名]
    def testMulDouble(self):
        """
        Ints are promoted by doubles during multiplication.
        """

        i = IntObject(4)
        result = i.call(u"multiply", [DoubleObject(2.1)])
        self.assertTrue(isinstance(result, DoubleObject))
        self.assertEqual(result.getDouble(), 8.4)
开发者ID:markrwilliams,项目名称:typhon,代码行数:11,代码来源:test_data.py

示例2: testShiftLeftLarge

# 需要导入模块: from typhon.objects.data import IntObject [as 别名]
# 或者: from typhon.objects.data.IntObject import call [as 别名]
 def testShiftLeftLarge(self):
     i = IntObject(0x5c5c)
     result = i.call(u"shiftLeft", [IntObject(64)])
     bi = rbigint.fromint(0x5c5c).lshift(64)
     self.assertTrue(result.bi.eq(bi))
开发者ID:markrwilliams,项目名称:typhon,代码行数:7,代码来源:test_data.py

示例3: testModPow

# 需要导入模块: from typhon.objects.data import IntObject [as 别名]
# 或者: from typhon.objects.data.IntObject import call [as 别名]
 def testModPow(self):
     i = IntObject(3)
     result = i.call(u"modPow", [IntObject(1000000), IntObject(255)])
     self.assertEqual(result.getInt(), 171)
开发者ID:markrwilliams,项目名称:typhon,代码行数:6,代码来源:test_data.py

示例4: testPow

# 需要导入模块: from typhon.objects.data import IntObject [as 别名]
# 或者: from typhon.objects.data.IntObject import call [as 别名]
 def testPow(self):
     i = IntObject(3)
     result = i.call(u"pow", [IntObject(100)])
     self.assertTrue(result.bi.eq(rbigint.fromint(3).pow(rbigint.fromint(100))))
开发者ID:markrwilliams,项目名称:typhon,代码行数:6,代码来源:test_data.py

示例5: testPowSmall

# 需要导入模块: from typhon.objects.data import IntObject [as 别名]
# 或者: from typhon.objects.data.IntObject import call [as 别名]
 def testPowSmall(self):
     i = IntObject(5)
     result = i.call(u"pow", [IntObject(7)])
     self.assertEqual(result.getInt(), 78125)
开发者ID:markrwilliams,项目名称:typhon,代码行数:6,代码来源:test_data.py

示例6: testAdd

# 需要导入模块: from typhon.objects.data import IntObject [as 别名]
# 或者: from typhon.objects.data.IntObject import call [as 别名]
 def testAdd(self):
     i = IntObject(32)
     result = i.call(u"add", [IntObject(11)])
     self.assertEqual(result.getInt(), 43)
开发者ID:markrwilliams,项目名称:typhon,代码行数:6,代码来源:test_data.py

示例7: testSubtractDouble

# 需要导入模块: from typhon.objects.data import IntObject [as 别名]
# 或者: from typhon.objects.data.IntObject import call [as 别名]
 def testSubtractDouble(self):
     i = IntObject(5)
     result = i.call(u"subtract", [DoubleObject(1.5)])
     self.assertAlmostEqual(result.getDouble(), 3.5)
开发者ID:markrwilliams,项目名称:typhon,代码行数:6,代码来源:test_data.py

示例8: testShiftRightLarge

# 需要导入模块: from typhon.objects.data import IntObject [as 别名]
# 或者: from typhon.objects.data.IntObject import call [as 别名]
 def testShiftRightLarge(self):
     i = IntObject(0x7fffffffffffffff)
     result = i.call(u"shiftRight", [IntObject(64)])
     self.assertEqual(result.getInt(), 0x0)
开发者ID:markrwilliams,项目名称:typhon,代码行数:6,代码来源:test_data.py

示例9: testMin

# 需要导入模块: from typhon.objects.data import IntObject [as 别名]
# 或者: from typhon.objects.data.IntObject import call [as 别名]
 def testMin(self):
     i = IntObject(3)
     result = i.call(u"min", [IntObject(5)])
     self.assertEqual(result.getInt(), 3)
开发者ID:markrwilliams,项目名称:typhon,代码行数:6,代码来源:test_data.py

示例10: testComplement

# 需要导入模块: from typhon.objects.data import IntObject [as 别名]
# 或者: from typhon.objects.data.IntObject import call [as 别名]
 def testComplement(self):
     i = IntObject(5)
     result = i.call(u"complement", [])
     self.assertEqual(result.getInt(), -6)
开发者ID:markrwilliams,项目名称:typhon,代码行数:6,代码来源:test_data.py

示例11: testMax

# 需要导入模块: from typhon.objects.data import IntObject [as 别名]
# 或者: from typhon.objects.data.IntObject import call [as 别名]
 def testMax(self):
     i = IntObject(3)
     result = i.call(u"max", [IntObject(5)])
     self.assertEqual(result.getInt(), 5)
开发者ID:markrwilliams,项目名称:typhon,代码行数:6,代码来源:test_data.py

示例12: testApproxDivideBigInt

# 需要导入模块: from typhon.objects.data import IntObject [as 别名]
# 或者: from typhon.objects.data.IntObject import call [as 别名]
 def testApproxDivideBigInt(self):
     i = IntObject(7937000378463977)
     # Hack.
     bi = BigInt(rbigint.fromint(1000000000000000000).int_mul(10))
     result = i.call(u"approxDivide", [bi])
     self.assertAlmostEqual(result._d, 0.0007937000378463977)
开发者ID:markrwilliams,项目名称:typhon,代码行数:8,代码来源:test_data.py

示例13: testApproxDivide

# 需要导入模块: from typhon.objects.data import IntObject [as 别名]
# 或者: from typhon.objects.data.IntObject import call [as 别名]
 def testApproxDivide(self):
     i = IntObject(4)
     result = i.call(u"approxDivide", [IntObject(2)])
     self.assertAlmostEqual(result.getDouble(), 2.0)
开发者ID:markrwilliams,项目名称:typhon,代码行数:6,代码来源:test_data.py

示例14: testAddDouble

# 需要导入模块: from typhon.objects.data import IntObject [as 别名]
# 或者: from typhon.objects.data.IntObject import call [as 别名]
 def testAddDouble(self):
     i = IntObject(32)
     result = i.call(u"add", [DoubleObject(1.1)])
     self.assertAlmostEqual(result.getDouble(), 33.1)
开发者ID:markrwilliams,项目名称:typhon,代码行数:6,代码来源:test_data.py

示例15: testShiftLeftFar

# 需要导入模块: from typhon.objects.data import IntObject [as 别名]
# 或者: from typhon.objects.data.IntObject import call [as 别名]
 def testShiftLeftFar(self):
     i = IntObject(0x1)
     result = i.call(u"shiftLeft", [IntObject(65)])
     bi = rbigint.fromint(0x1).lshift(65)
     self.assertTrue(result.bi.eq(bi))
开发者ID:markrwilliams,项目名称:typhon,代码行数:7,代码来源:test_data.py


注:本文中的typhon.objects.data.IntObject.call方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。