*/
static PyObject *
-math_1_to_whatever(PyObject *arg, double (*func) (double),
- PyObject *(*from_double_func) (double),
- int can_overflow)
+math_1(PyObject *arg, double (*func) (double), int can_overflow)
{
double x, r;
x = PyFloat_AsDouble(arg);
/* this branch unnecessary on most platforms */
return NULL;
- return (*from_double_func)(r);
+ return PyFloat_FromDouble(r);
}
/* variant of math_1, to be used when the function being wrapped is known to
OverflowError.
*/
-static PyObject *
-math_1(PyObject *arg, double (*func) (double), int can_overflow)
-{
- return math_1_to_whatever(arg, func, PyFloat_FromDouble, can_overflow);
-}
-
static PyObject *
math_2(PyObject *const *args, Py_ssize_t nargs,
double (*func) (double, double), const char *funcname)