本文整理汇总了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)
示例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))
示例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)
示例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))))
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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))