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.
1 parent 7202c22 commit 685fa66Copy full SHA for 685fa66
bbi/cbbi.pyx
@@ -1061,13 +1061,15 @@ cdef inline void array_query_summarized(
1061
1062
# Fill output array
1063
cdef double covFactor = <double>nbins / (end - start)
1064
+ cdef double step = (end - start) / nbins
1065
cdef bbiSummaryElement *el
1066
cdef double val
- cdef int loc, i
1067
+ cdef int bin_start, bin_end, i
1068
if result:
1069
for i in range(nbins):
- loc = start + i*stepSize
1070
- if loc < validStart or loc >= validEnd:
+ bin_start = start + <int>(<double>i * step)
1071
+ bin_end = start + <int>(<double>(i + 1) * step)
1072
+ if bin_start < validStart or bin_end > validEnd:
1073
out[i] = oob
1074
else:
1075
el = &elements[i]
0 commit comments