We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b28d3bf + 5e50259 commit b18e7ddCopy full SHA for b18e7dd
sklearn/neighbors/dist_metrics.pyx
@@ -981,10 +981,10 @@ cdef class HaversineDistance(DistanceMetric):
981
return 2 * asin(sqrt(sin_0 * sin_0
982
+ cos(x1[0]) * cos(x2[0]) * sin_1 * sin_1))
983
984
- cdef inline DTYPE_t _rdist_to_dist(self, DTYPE_t rdist):
+ cdef inline DTYPE_t _rdist_to_dist(self, DTYPE_t rdist) except -1:
985
return 2 * asin(sqrt(rdist))
986
987
- cdef inline DTYPE_t _dist_to_rdist(self, DTYPE_t dist):
+ cdef inline DTYPE_t _dist_to_rdist(self, DTYPE_t dist) except -1:
988
cdef DTYPE_t tmp = sin(0.5 * dist)
989
return tmp * tmp
990
0 commit comments