H5Dread: reading integer data into a float array

The “Data Transfer: Datatype Conversion and Selection” section of the API documentation says:

In order to be convertible, the datatype of the source and destination must have the same datatype class (with the exception of enumeration type). Thus, integers can be converted to other integers, and floats to other floats, but integers cannot (yet) be converted to floats.

Is this still the case?

What’s New in HDF5 1.8.0 says something contradictory:

Integer-to-Floating-point Conversion Support – It is now possible for the HDF5 library to convert between integer and floating-point datatypes.

I am investigating a program, which seems to read an integer array in an HDF5 into a float memory buffer. The software is working fine but I would like to make sure this is a properly supported use case, not something that just happens to work but is not guaranteed.

Welcome & good catch! The documentation is wrong. If you are curious about what conversions are pre-defined, have a look at H5Tconv.c. The integer-to-float conversions start around line 6,800, e.g., H5T__conv_schar_float.

Best, G.

Great! Thank you very much for clarification. This assured me.