summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/h5dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5dump/h5dump.c')
-rw-r--r--tools/h5dump/h5dump.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index 2389ef4..694c634 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -2507,7 +2507,7 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id)
int ndims = H5Sget_simple_extent_dims( sid, dims, NULL);
hsize_t nelmts = 1;
hsize_t size;
- double per = 0;
+ double ratio = 0;
hssize_t a, b;
int ok = 0;
@@ -2539,13 +2539,13 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id)
size = nelmts * datum_size;
a = size; b = storage_size;
- if (a!=0)
- per = (double) (b-a)/a;
-
- per = -per;
- per *=100;
- HDfprintf(stdout, "SIZE %Hu (%.1f%%COMPRESSION)\n ", storage_size, per);
+ /* compression ratio = uncompressed size / compressed size */
+
+ if (b!=0)
+ ratio = (double) a / (double) b;
+
+ HDfprintf(stdout, "SIZE %Hu (%.3f:1 COMPRESSION)\n ", storage_size, ratio);
}
else