Skip to content
Snippets Groups Projects
Commit 0981af9f authored by Alice Brenon's avatar Alice Brenon
Browse files

Fix bug in resampling due to floating-point computation errors

parent 1bbdb0e9
No related branches found
No related tags found
No related merge requests found
...@@ -21,4 +21,4 @@ def resample(newSize, distribution): ...@@ -21,4 +21,4 @@ def resample(newSize, distribution):
for i in range(newSize): for i in range(newSize):
yield oldSize/lcm*sum([distribution[j]*intersection(i, j) yield oldSize/lcm*sum([distribution[j]*intersection(i, j)
for j in range(math.floor(i*ratio), for j in range(math.floor(i*ratio),
math.ceil((i+1)*ratio))]) round((i+1)*ratio))])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment