diff --git a/src/fabelous_math/cpp/functions/bindings/sqrt_bindings.cpp b/src/fabelous_math/cpp/functions/bindings/sqrt_bindings.cpp deleted file mode 100644 index adf5436..0000000 --- a/src/fabelous_math/cpp/functions/bindings/sqrt_bindings.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include -#include "sqrt.hpp" -#include - -static PyObject* fabelous_sqrt_wrapper(PyObject* self, PyObject* args) { - long long number; - if (!PyArg_ParseTuple(args, "L", &number)) { // Ensure 'L' is correct for long long - return NULL; - } - try { - double result = fabelous_sqrt::sqrt(number); // Adjust to match the actual return type - return PyFloat_FromDouble(result); - } catch (const std::invalid_argument& e) { // Ensure this is the correct exception - PyErr_SetString(PyExc_ValueError, e.what()); - return NULL; - } -} - -static PyMethodDef SqrtMethods[] = { - {"fabelous_sqrt", fabelous_sqrt_wrapper, METH_VARARGS, "Compute the square root of a long number"}, - {NULL, NULL, 0, NULL} -}; - -static struct PyModuleDef sqrt_module = { - PyModuleDef_HEAD_INIT, - "sqrt", - "Module for computing the square root of a number", - -1, - SqrtMethods -}; - -PyMODINIT_FUNC PyInit_sqrt(void) { - return PyModule_Create(&sqrt_module); -} \ No newline at end of file