[Mesa-dev] [PATCH shader-db 3/4] si-report.py: report % change correctly for 0->N

Marek Olšák maraeo at gmail.com
Thu Jul 14 14:28:33 UTC 2016


From: Marek Olšák <marek.olsak at amd.com>

not all places are fixed
---
 si-report.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/si-report.py b/si-report.py
index c5855ff..523c452 100755
--- a/si-report.py
+++ b/si-report.py
@@ -39,7 +39,7 @@ def get_str(value, suffix = ' %'):
 
 def calculate_percent_change(b, a):
     if b == 0:
-        return 0
+        return 0 if a == 0 else float("inf")
     return 100 * float(a - b) / float(b)
 
 def cmp_max_unit(current, comp):
-- 
2.7.4



More information about the mesa-dev mailing list