tests/block_weight: use integer division when computing median

release-v0.6.1.2
stoffu 5 years ago
parent 815d08dc5f
commit 467f4c7ed3
No known key found for this signature in database
GPG Key ID: 41DAB8343A9EC012

@ -23,9 +23,9 @@ def get_median(vec):
#temp = vec
temp = sorted(vec)
if len(temp) % 2 == 1:
return temp[len(temp)/2]
return temp[len(temp)//2]
else:
return int((temp[len(temp)/2]+temp[len(temp)/2-1])/2)
return int((temp[len(temp)//2]+temp[len(temp)//2-1])//2)
def LCG():
global lcg_seed

Loading…
Cancel
Save