From 8acdab81117702d6315dddb921ca572d0c16c046 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Sun, 6 Dec 2020 09:00:35 +1000 Subject: [PATCH] analyse: correct the percentage calculation scale --- tools/analyse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/analyse.cpp b/tools/analyse.cpp index 75d9133..fc4f314 100644 --- a/tools/analyse.cpp +++ b/tools/analyse.cpp @@ -161,7 +161,7 @@ int main (int argc, char const **argv) ); auto const duplicated_bytes = total_bytes - unique_bytes; - float const duplicated_fraction = float (duplicated_bytes) / total_bytes; + float const duplicated_fraction = 100.f * duplicated_bytes / total_bytes; std::cout << duplicated_bytes << " duplicated bytes of " << total_bytes << " (" << duplicated_fraction << "%)\n"; std::cout << (src.elements.size () - unique.size ()) << " duplicates\n";