feat: main structure + basic math testing

This commit is contained in:
2025-11-14 23:00:38 +01:00
parent baa74c8b0a
commit 90f0e44e22
7 changed files with 40 additions and 2 deletions

26
src/modules/math.py Normal file
View File

@@ -0,0 +1,26 @@
from cmath import log as complex_log # used for complex numbers
from math import log
def t_summ():
# Equivalent to summatory of 2*i from i=1 to i=5
return sum(2*i for i in range(1,6))
def t_exponent(base, exponent):
return base**exponent
def t_logarithm(n, base):
return log(n, base)
def t_complex_logarithm(n, base):
return complex_log(n, base)
def t_compound_interest(input, interest, span, periods):
return input * ((1 + (interest / periods))**(periods * span))
def t_compound_interest_algorigthm(input, interest, span, periods):
result = input
for _ in range(0, span):
for _ in range(0, periods):
result += result * (interest / periods)
return result