From b5aff8d4c2dc08d908f08a8dd62de4d828966a49 Mon Sep 17 00:00:00 2001 From: fd7794 Date: Tue, 6 Feb 2024 11:46:16 +0100 Subject: [PATCH] added calculation for simplify_exponential_function --- src/main/py/read_math_function.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/py/read_math_function.py b/src/main/py/read_math_function.py index add7387..49c0bad 100644 --- a/src/main/py/read_math_function.py +++ b/src/main/py/read_math_function.py @@ -80,4 +80,6 @@ def simplify_exponential_function(type, function): return "Der Ausdruck muss die Variable 'x' enthalten." coefficient, exponent = function.split('x^') coefficient = int(coefficient) if coefficient else 1 - exponent = int(exponent) \ No newline at end of file + exponent = int(exponent) + new_coefficient = coefficient * exponent + new_exponent = exponent - 1 \ No newline at end of file