Change ** to ^ and mod test in render
This commit is contained in:
parent
9b104f020f
commit
d74e18b663
@ -35,7 +35,7 @@ class FormalExp(object):
|
|||||||
:returns: a_n
|
:returns: a_n
|
||||||
|
|
||||||
"""
|
"""
|
||||||
pattern = "\w\*\*(\d*)"
|
pattern = "\w\^(\d*)"
|
||||||
finder = re.compile(pattern)
|
finder = re.compile(pattern)
|
||||||
power = {}
|
power = {}
|
||||||
for (k,v) in self._coef.items():
|
for (k,v) in self._coef.items():
|
||||||
@ -138,9 +138,9 @@ class FormalExp(object):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
fe1 = FormalExp({"x": 1, "":2})
|
fe1 = FormalExp({"x": 1, "":2})
|
||||||
print(fe1)
|
print(fe1.get_postfix())
|
||||||
fe2 = FormalExp({"x**12": 5, "":2})
|
fe2 = FormalExp({"x^12": 5, "":2})
|
||||||
print(fe2)
|
print(fe2.get_postfix())
|
||||||
fe3 = fe1 * fe2
|
fe3 = fe1 * fe2
|
||||||
for s in fe3:
|
for s in fe3:
|
||||||
print(s)
|
print(s)
|
||||||
|
Loading…
Reference in New Issue
Block a user