Example #1
0
 def _repr_(self):
     approximation = self._approximation
     length = max(approximation.length(), self.precision().last())
     if length >= 0:
         coeffs = [ self[i] for i in range(length) ]
         from printing import repr_polynomial
         return repr_polynomial(coeffs, self.variable_name())
     else:
         return RingElement_inexact._repr_(self)
Example #2
0
 def __init__(self, parent, function, **kwargs):
     if isinstance(function, list):
         from printing import repr_polynomial
         self.repr = lambda: repr_polynomial(function, parent.variable_name())
         kwargs['parenthesis_level'] = 0
     LazyApproximation.__init__(self, parent, function, **kwargs)
     if self._length >= 0:
         self._expected_degree = self._length - 1
     else:
         self._expected_degree = Infinity