Signed-off-by: Pierre Moreau <pierre.mor...@free.fr>
---
 nv-report.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/nv-report.py b/nv-report.py
index abd6110..724c662 100644
--- a/nv-report.py
+++ b/nv-report.py
@@ -62,7 +62,12 @@ def analyze(fname):
     return stats
 
 def diff(a, b):
-    return "%d -> %d (%.2f%%)" % (a, b, b * 100. / a - 100.)
+    percentage = 0.
+    if a != 0.:
+        percentage = b * 100. / a - 100.
+    elif b != 0.:
+        percentage = float('inf')
+    return "%d -> %d (%.2f%%)" % (a, b, percentage)
 
 def main(argv):
     # Count up each of the metrics in the before and after, and
-- 
2.14.2

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to