Skip to content

Commit fa86c2f

Browse files
committed
changing compression ratio formula
1 parent 9f71b77 commit fa86c2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lzw16pack.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ int Compress(const char *filename, const char *outfile, int flags)
512512
long orig_size = fileSize (filename);
513513
long compressed_size = fileSize (outfile);
514514

515-
printf ("Compression ratio %.2f%%\n", 100.0 * compressed_size / orig_size);
515+
printf ("Compression ratio %.2f%%\n", 100.0 * (orig_size - compressed_size) / orig_size);
516516
}
517517

518518
return ret;
@@ -539,7 +539,7 @@ int Compress2 (const char *filename, const char *outfile, int flags, int max_bit
539539
long orig_size = fileSize (filename);
540540
long compressed_size = fileSize (outfile);
541541

542-
printf ("Compression ratio %.2f%%\n", 100.0 * compressed_size / orig_size);
542+
printf ("Compression ratio %.2f%%\n", 100.0 * (orig_size - compressed_size) / orig_size);
543543
}
544544

545545
return ret;

0 commit comments

Comments
 (0)