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