From 467f4c7ed303ca56bb0545716791c84fe11e3ce6 Mon Sep 17 00:00:00 2001 From: stoffu Date: Tue, 9 Apr 2019 19:13:55 +0900 Subject: [PATCH] tests/block_weight: use integer division when computing median --- tests/block_weight/block_weight.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/block_weight/block_weight.py b/tests/block_weight/block_weight.py index ae75844e2..b23da3d77 100755 --- a/tests/block_weight/block_weight.py +++ b/tests/block_weight/block_weight.py @@ -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