Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note to H5Tset_fields about needing to set datatype precision first #4059

Merged
merged 3 commits into from
Mar 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/H5Tpublic.h
Original file line number Diff line number Diff line change
Expand Up @@ -2568,6 +2568,17 @@ H5_DLL herr_t H5Tset_sign(hid_t type_id, H5T_sign_t sign);
* Fields are not allowed to extend beyond the number of bits of
* precision, nor are they allowed to overlap with one another.
*
* \note The size and precision of, as well as any offset for, a floating-point
* datatype should generally be set appropriately before calling
* H5Tset_fields(). Otherwise, H5Tset_fields() may fail when checking that
* the values make sense for the datatype. However, if the precision of a
* floating-point datatype will be decreased during its creation with a call
* to H5Tset_precision(), then H5Tset_fields() should instead be called
* first to set appropriate values for \p spos, \p epos, \p esize, \p mpos
* and \p msize before reducing the precision of the datatype with
* H5Tset_precision(). This is of particular concern if another floating-point
* datatype was copied as a starting point.
*
* \since 1.0.0
*
*/
Expand Down
Loading