Fix(Fraction): debug successive division (1 to MOnumber(1))
This commit is contained in:
@@ -174,6 +174,22 @@ class Expression(object):
|
||||
10 + 1680 * 9
|
||||
10 + 15120
|
||||
15130
|
||||
>>> e = Expression.from_str("1+2/3/4/5")
|
||||
>>> f = e.simplify()
|
||||
>>> for s in f.explain():
|
||||
... print(s)
|
||||
1 + 2 / 3 / 4 / 5
|
||||
1 + (2 / 3 * 1 / 4) / 5
|
||||
1 + (2 * 1) / (3 * 4) / 5
|
||||
1 + 2 / 12 / 5
|
||||
1 + 2 / 12 * 1 / 5
|
||||
1 + (2 * 1) / (12 * 5)
|
||||
1 + 2 / 60
|
||||
1 / 1 + 2 / 60
|
||||
(1 * 60) / (1 * 60) + 2 / 60
|
||||
60 / 60 + 2 / 60
|
||||
(60 + 2) / 60
|
||||
62 / 60
|
||||
"""
|
||||
try:
|
||||
yield from self._ancestor.explain()
|
||||
|
Reference in New Issue
Block a user