Ejemplo n.º 1
0
 def testFloat(self): assert float(univ.Real(4.0))==4.0,'__float__() fails'
 def testPrettyIn(self): assert univ.Real((3,10,0)) == 3, 'prettyIn() fails'
Ejemplo n.º 2
0
 def testLong(self):
     assert int(univ.Real(8.0)) == 8, '__long__() fails'
Ejemplo n.º 3
0
 def testPrettyIn(self):
     assert univ.Real((3, 10, 0)) == 3, 'prettyIn() fails'
Ejemplo n.º 4
0
 def testRmod(self):
     assert 4 % univ.Real(3.0) == 1, '__rmod__() fails'
Ejemplo n.º 5
0
 def testRpow(self):
     assert 2**univ.Real(2.0) == 4, '__rpow__() fails'
Ejemplo n.º 6
0
 def testRmul(self):
     assert 2 * univ.Real(3.0) == 6, '__rmul__() fails'
Ejemplo n.º 7
0
 def testRdiv(self):
     assert 6 / univ.Real(3.0) == 2, '__rdiv__() fails'
Ejemplo n.º 8
0
 def testPrettyInInf(self):
     assert univ.Real(float('inf')) == float('inf'), 'prettyIn() fails'
Ejemplo n.º 9
0
 def testPlusInf(self):
     assert univ.Real('inf').isPlusInfinity(), 'isPlusInfinity failed'
Ejemplo n.º 10
0
 def testRaddInf(self):
     assert 1 + univ.Real('inf') == float('inf'), '__radd__() fails'
Ejemplo n.º 11
0
 def testFloatInf(self):
     assert float(univ.Real('-inf')) == float('-inf'),'__float__() fails'
Ejemplo n.º 12
0
 def testAddInf(self):
     assert univ.Real('inf') + 1 == float('inf'), '__add__() fails'
Ejemplo n.º 13
0
 def testReprInf(self):
     assert repr(univ.Real('inf')) == 'Real(\'inf\')','repr() fails'
Ejemplo n.º 14
0
 def testPrettyIn(self): assert univ.Real((3,10,0)) == 3, 'prettyIn() fails'
 # infinite float values
 def testStrInf(self):
Ejemplo n.º 15
0
 def testRsub(self):
     assert 6.1 - univ.Real(0.1) == 6, '__rsub__() fails'
Ejemplo n.º 16
0
 def testMinusInf(self):
     assert univ.Real('-inf').isMinusInfinity(), 'isMinusInfinity failed'
Ejemplo n.º 17
0
 def testMul(self):
     assert univ.Real(3.0) * -3 == -9, '__mul__() fails'
Ejemplo n.º 18
0
 def testTag(self):
     assert univ.Real().getTagSet() == tag.TagSet(
         (),
         tag.Tag(tag.tagClassUniversal, tag.tagFormatSimple, 0x09)
         )
Ejemplo n.º 19
0
 def testDiv(self):
     assert univ.Real(3.0) / 2 == 1.5, '__div__() fails'
Ejemplo n.º 20
0
 def testStr(self):
     assert str(univ.Real(1.0)) == '1.0', 'str() fails'
Ejemplo n.º 21
0
 def testMod(self):
     assert univ.Real(3.0) % 2 == 1, '__mod__() fails'
Ejemplo n.º 22
0
 def testRepr(self):
     assert repr(univ.Real(-4.1)) == 'Real((-41, 10, -1))', 'repr() fails'
Ejemplo n.º 23
0
 def testPow(self):
     assert univ.Real(3.0)**2 == 9, '__pow__() fails'
Ejemplo n.º 24
0
 def testAdd(self):
     assert univ.Real(-4.1) + 1.4 == -2.7, '__add__() fails'
Ejemplo n.º 25
0
 def testInt(self):
     assert int(univ.Real(3.0)) == 3, '__int__() fails'
Ejemplo n.º 26
0
 def testRadd(self):
     assert 4 + univ.Real(0.5) == 4.5, '__radd__() fails'
Ejemplo n.º 27
0
 def testFloat(self):
     assert float(univ.Real(4.0)) == 4.0, '__float__() fails'
Ejemplo n.º 28
0
 def testSub(self):
     assert univ.Real(3.9) - 1.7 == 2.2, '__sub__() fails'
Ejemplo n.º 29
0
 def testStrInf(self):
     assert str(univ.Real('inf')) == 'inf', 'str() fails'
Ejemplo n.º 30
0
 def testLong(self): assert int(univ.Real(8.0)) == 8, '__long__() fails'
 def testFloat(self): assert float(univ.Real(4.0))==4.0,'__float__() fails'