If you have the C code, or C++, it may be possible to write your own type and expose it to python, do the math on the C++ side
I do this with boost::python, classes like vector and matrix, provide the operators, do the math in C++ return the results to python
pseudo code
I do this with boost::python, classes like vector and matrix, provide the operators, do the math in C++ return the results to python
pseudo code
class_<PyLargeInteger>("LargeInteger") .def(init<int64_t&>()) .def("__eq__", &PyLargeInteger::func) .def("__ne__", &PyLargeInteger::func) .def("__mul__", &PyLargeInteger::func) .def("__rmul__", &PyLargeInteger::func) .def("__truediv__", &PyLargeInteger::funcd) .def("__itruediv__", &PyLargeInteger::func) .def("__add__", &PyLargeInteger::func) .def("__iadd__", &PyLargeInteger::func) .def("__sub__", &PyLargeInteger::func) .def("__isub__", &PyLargeInteger::func) .def("__str__", &PyLargeInteger::func) .def("__repr__", &PyLargeInteger::func) ;