tests/block_weight: use integer division when computing median

This commit is contained in:
stoffu 2019-04-09 19:13:55 +09:00
parent 815d08dc5f
commit 467f4c7ed3
No known key found for this signature in database
GPG Key ID: 41DAB8343A9EC012
1 changed files with 2 additions and 2 deletions

View File

@ -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