diff --git a/example.py b/example.py index 3d51763..da2aaab 100644 --- a/example.py +++ b/example.py @@ -1,4 +1,6 @@ -from fabelous_math import is_even, is_odd, rooting +from fabelous_math import is_even, is_odd, rooting, approximate_pi + +print(approximate_pi(10000000)) print(rooting(0.5)) print(is_even(5)) diff --git a/pyproject.toml b/pyproject.toml index d8448a0..8ba9880 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "fabelous_math" -version = "0.2.1" +version = "0.3.14" description = "Math functions written in C++ for faster code" authors = [ {name = "Falko Habel", email = "falko.habel@fabelous.app"} diff --git a/setup.py b/setup.py index 3661352..bcd9e9f 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,16 @@ simple_functions_module = Extension( extra_link_args=extra_link_args, ) +pi_module = Extension( + 'fabelous_math.pi', + sources=[ + 'src/fabelous_math/cpp/functions/pi.cpp', + 'src/fabelous_math/cpp/functions/bindings/pi_bindings.cpp' + ], + include_dirs=['src/fabelous_math/include'], + extra_compile_args=extra_compile_args, + extra_link_args=extra_link_args, +) sqrt_module = Extension( 'fabelous_math.rooting', @@ -36,7 +46,7 @@ sqrt_module = Extension( setup( name='fabelous_math', description='Math functions written in C++ for faster code', - ext_modules=[simple_functions_module, sqrt_module], + ext_modules=[simple_functions_module, sqrt_module, pi_module], author="Falko Habel", author_email="falko.habel@fabelous.app" ) \ No newline at end of file diff --git a/src/fabelous_math/__init__.py b/src/fabelous_math/__init__.py index 1660b52..4d829a3 100644 --- a/src/fabelous_math/__init__.py +++ b/src/fabelous_math/__init__.py @@ -1,4 +1,5 @@ from fabelous_math.simple_functions import is_even, is_odd +from fabelous_math.pi import approximate_pi from fabelous_math.rooting import rooting -__all__ = ["is_even", "is_odd", "rooting"] \ No newline at end of file +__all__ = ["is_even", "is_odd", "approximate_pi", "rooting"] \ No newline at end of file