Beispiel #1
0
 def remakeConstructor(self):
     if self.getStyle('exponent') == 'radical':
         # Use a different constructor if using the 'radical' style.
         if self.exponent == frac(one, two):
             return 'sqrt' 
         else:
             raise ValueError("Unkown radical type, exponentiating to the power "
                              "of %s"%str(self.exponent))
     return Operation.remakeConstructor(self)
Beispiel #2
0
 def remakeConstructor(self):
     if self.getStyle('division') == 'fraction':
         return 'Frac' # use a different constructor if using the fraction style
     return Operation.remakeConstructor(self)