mod __tex__ and __txt__ for Polynom

This commit is contained in:
Lafrite 2015-03-07 11:05:15 +01:00
parent 6e1783da43
commit 4296242afd

View File

@ -6,7 +6,7 @@ from .expression import Expression
from .explicable import Explicable from .explicable import Explicable
from .operator import op from .operator import op
from .generic import spe_zip, expand_list, isNumber, transpose_fill, flatten_list, isPolynom, isNumerand from .generic import spe_zip, expand_list, isNumber, transpose_fill, flatten_list, isPolynom, isNumerand
from .render import txt from .render import txt,tex
from .random_expression import RdExpression from .random_expression import RdExpression
from itertools import chain from itertools import chain
from functools import wraps from functools import wraps
@ -171,10 +171,10 @@ class Polynom(Explicable):
return "< Polynom " + str(self._coef) + ">" return "< Polynom " + str(self._coef) + ">"
def __txt__(self): def __txt__(self):
return self.postfix_tokens return txt(self.postfix_tokens)
def __tex__(self): def __tex__(self):
return self.postfix_tokens return tex(self.postfix_tokens)
def coef_postfix(self, a, i): def coef_postfix(self, a, i):
"""Return the postfix display of a coeficient """Return the postfix display of a coeficient