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