Add math helper module

Currently with GCD and LCD functions, along with unit tests.
This commit is contained in:
Clemens Schwaighofer
2025-12-18 17:21:14 +09:00
parent 523e61c9f7
commit 9034a31cd6
4 changed files with 156 additions and 0 deletions

View File

View File

@@ -0,0 +1,35 @@
"""
Various math helpers
"""
import math
def gcd(a: int, b: int):
"""
Calculate: Greatest Common Divisor
Arguments:
a {int} -- _description_
b {int} -- _description_
Returns:
_type_ -- _description_
"""
return math.gcd(a, b)
def lcd(a: int, b: int):
"""
Calculate: Least Common Denominator
Arguments:
a {int} -- _description_
b {int} -- _description_
Returns:
_type_ -- _description_
"""
return math.lcm(a, b)
# __END__