Index: utils/ABITest/TypeGen.py =================================================================== --- utils/ABITest/TypeGen.py +++ utils/ABITest/TypeGen.py @@ -1,5 +1,5 @@ """Flexible enumeration of C types.""" -from __future__ import print_function +from __future__ import division, print_function from Enumeration import * @@ -235,7 +235,7 @@ # Compute the number of combinations (n choose k) def num_combinations(n, k): - return fact(n) / (fact(k) * fact(n - k)) + return fact(n) // (fact(k) * fact(n - k)) # Enumerate the combinations choosing k elements from the list of values def combinations(values, k): Index: utils/analyzer/CmpRuns.py =================================================================== --- utils/analyzer/CmpRuns.py +++ utils/analyzer/CmpRuns.py @@ -25,7 +25,7 @@ diff = compareResults(resultsA, resultsB) """ -from __future__ import print_function +from __future__ import division, print_function from collections import defaultdict @@ -305,10 +305,10 @@ combined_stats[str(key)] = { "max": max(values), "min": min(values), - "mean": sum(values) / len(values), + "mean": sum(values) // len(values), "90th %tile": computePercentile(values, 0.9), "95th %tile": computePercentile(values, 0.95), - "median": sorted(values)[len(values) / 2], + "median": sorted(values)[len(values) // 2], "total": sum(values) } return combined_stats @@ -327,7 +327,7 @@ # Only apply highlighting when writing to TTY and it's not Windows if sys.stdout.isatty() and os.name != 'nt': if valB != 0: - ratio = (valB - valA) / valB + ratio = (valB - valA) // valB if ratio < -0.2: report = Colors.GREEN + report + Colors.CLEAR elif ratio > 0.2: