removed outdated file
Gitea Actions For Fabelous-Math / Explore-Gitea-Actions (push) Successful in 19s Details

This commit is contained in:
Falko Victor Habel 2025-03-14 14:09:11 +01:00
parent fc840bb42b
commit 0a25cdf333
1 changed files with 0 additions and 34 deletions

View File

@ -1,34 +0,0 @@
#include <Python.h>
#include "sqrt.hpp"
#include <stdexcept>
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);
}