H5Z-ZFP icon indicating copy to clipboard operation
H5Z-ZFP copied to clipboard

Incorrect/ambiguous `cd_values` documentation

Open lindstro opened this issue 1 year ago • 0 comments

The documentation of how H5Z-ZFP encodes cd_values suggests that double-precision values are type punned as two unsigned 32-bit integers in the "wrong" order. It says: "A/B are high/low 32-bit words of a double" with A stored before B. The way I read this, A would be the high 32 bits and B the low 32 bits. However, the double is simply stored in little-endian order, with the first word holding the low 32 bits, as is clear from using print_h5repack_farg:

print_h5repack_farg zfpmode=3 acc=1.0
...
h5repack -f argument...
    -f UD=32013,0,4,3,0,0,1072693248

Here 1072693248 = 0x3ff00000 is the high word with 0x3ff representing the exponent. I would propose correcting the order and also using L and H (or Lo, Hi) in place of A and B.

lindstro avatar Oct 10 '24 17:10 lindstro