scikit-learn/sklearn/utils/lgamma.pyx

9 lines
217 B
Cython

cdef extern from "src/gamma.h":
cdef double sklearn_lgamma(double x)
cdef double lgamma(double x):
if x <= 0:
raise ValueError("x must be strictly positive, got %f" % x)
return sklearn_lgamma(x)