diff --git a/__pycache__/app.cpython-37.pyc b/__pycache__/app.cpython-37.pyc index 62432a8..f5a8ddd 100644 Binary files a/__pycache__/app.cpython-37.pyc and b/__pycache__/app.cpython-37.pyc differ diff --git a/app.py b/app.py index 139d12d..641bfde 100644 --- a/app.py +++ b/app.py @@ -117,8 +117,8 @@ def maxmin(): # Get input from form f = request.form.get("function") - lb = sympify(request.form.get("lowerbound")) - ub = sympify(request.form.get("upperbound")) + lb = round(sympify(request.form.get("lowerbound")), 3) + ub = round(sympify(request.form.get("upperbound")), 3) # Setup our symbols for SymPy f = setup_symbols(f) @@ -126,7 +126,7 @@ def maxmin(): # Get Derivative, solve for real solutions, update candidates list fprime = f.diff(x) solutions = list() - solutions.append(f.subs(x,0)) + solutions.append(round(f.subs(x,0), 3)) candidates = list() for solution in solutions: candidates.append(solution) @@ -136,7 +136,7 @@ def maxmin(): # Fill values list with solutions values = list() for candidate in candidates: - temp = f.subs(x, candidate) + temp = round(f.subs(x, candidate), 3) values.append(temp) # Find max/min of values diff --git a/templates/differentiated.html b/templates/differentiated.html index fa6cef2..7fc1b18 100644 --- a/templates/differentiated.html +++ b/templates/differentiated.html @@ -9,4 +9,4 @@
For $f(x) = {{ value }}$
$f'(x) = {{ fprime }}$
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/templates/optimized.html b/templates/optimized.html index 7f04fb2..0f22585 100644 --- a/templates/optimized.html +++ b/templates/optimized.html @@ -61,4 +61,4 @@ -{% endblock %} \ No newline at end of file +{% endblock %}