tests/block_weight: use integer division when computing median
This commit is contained in:
parent
815d08dc5f
commit
467f4c7ed3
|
@ -23,9 +23,9 @@ def get_median(vec):
|
||||||
#temp = vec
|
#temp = vec
|
||||||
temp = sorted(vec)
|
temp = sorted(vec)
|
||||||
if len(temp) % 2 == 1:
|
if len(temp) % 2 == 1:
|
||||||
return temp[len(temp)/2]
|
return temp[len(temp)//2]
|
||||||
else:
|
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():
|
def LCG():
|
||||||
global lcg_seed
|
global lcg_seed
|
||||||
|
|
Loading…
Reference in New Issue