diff --git a/pymath/explicable.py b/pymath/explicable.py index 360235d..4db74b3 100644 --- a/pymath/explicable.py +++ b/pymath/explicable.py @@ -25,6 +25,7 @@ class Renderable(object): The default temporary render is Expression in order to perform calculus inside numbers + >>> from .expression import Expression >>> exp = Expression("2*3/5") >>> print(exp) 2 \\times \\frac{ 3 }{ 5 } diff --git a/pymath/expression.py b/pymath/expression.py index 2f63b3d..08ec98b 100644 --- a/pymath/expression.py +++ b/pymath/expression.py @@ -42,10 +42,10 @@ class Expression(Explicable): >>> with Expression.tmp_render(): ... for i in exp.simplify().explain(): ... i - < [2, 3, 5, '/', '*'] > - < [2, < Fraction 3 / 5>, '*'] > - < [2, < Fraction 3 / 5>, '*'] > - < [6, 5, '/'] > + < [2, 3, 5, '/', '*'] > + < [2, < Fraction 3 / 5>, '*'] > + < [2, < Fraction 3 / 5>, '*'] > + < [6, 5, '/'] > >>> from .render import txt >>> with Expression.tmp_render(txt): ... for i in exp.simplify().explain(): diff --git a/pymath/str2tokens.py b/pymath/str2tokens.py index ad340d7..7899a03 100644 --- a/pymath/str2tokens.py +++ b/pymath/str2tokens.py @@ -12,7 +12,7 @@ def str2tokens(exp): >>> str2tokens('2*3+4') [2, 3, '*', 4, '+'] >>> str2tokens('2x+4') - [2, < Polynom [0, 1]>, '*', 1, '+'] + [2, < Polynom [0, 1]>, '*', 4, '+'] """ in_tokens = str2in_tokens(exp) post_tokens = in2post_fix(in_tokens)