Help us improve by taking our short survey: https://www.hdfgroup.org/website-survey/
HDF5 Last Updated on 2025-12-07
The HDF5 Field Guide
Loading...
Searching...
No Matches
Alternative Floating Point Datatypes

Detailed Description

Alternative (non-IEEE) floating point types.

Predefined Alternative Floating Point Datatypes
Datatype Description
H5T_FLOAT_BFLOAT16BE 16-bit big-endian bfloat16 floating point
H5T_FLOAT_BFLOAT16LE 16-bit little-endian bfloat16 floating point
H5T_FLOAT_F8E4M3 8-bit FP8 E4M3 (4 exponent bits, 3 mantissa bits) floating point
H5T_FLOAT_F8E5M2 8-bit FP8 E5M2 (5 exponent bits, 2 mantissa bits) floating point

Macros

#define H5T_FLOAT_BFLOAT16BE   (H5OPEN H5T_FLOAT_BFLOAT16BE_g)
 
#define H5T_FLOAT_BFLOAT16LE   (H5OPEN H5T_FLOAT_BFLOAT16LE_g)
 
#define H5T_FLOAT_F8E4M3   (H5OPEN H5T_FLOAT_F8E4M3_g)
 
#define H5T_FLOAT_F8E5M2   (H5OPEN H5T_FLOAT_F8E5M2_g)
 

Macro Definition Documentation

◆ H5T_FLOAT_BFLOAT16BE

#define H5T_FLOAT_BFLOAT16BE   (H5OPEN H5T_FLOAT_BFLOAT16BE_g)

16-bit big-endian bfloat16 floating-point numbers

◆ H5T_FLOAT_BFLOAT16LE

#define H5T_FLOAT_BFLOAT16LE   (H5OPEN H5T_FLOAT_BFLOAT16LE_g)

16-bit little-endian bfloat16 floating-point numbers

◆ H5T_FLOAT_F8E4M3

#define H5T_FLOAT_F8E4M3   (H5OPEN H5T_FLOAT_F8E4M3_g)

8-bit FP8 E4M3 (4 exponent bits, 3 mantissa bits) floating-point numbers

Attention
Implicit datatype conversion should currently be avoided when using this datatype for I/O operations. Incomplete handling of non-IEEE floating-point formats in HDF5 can cause certain FP8 E4M3 values to be improperly converted to Infinities or NaN values. If possible, an application should perform I/O with this datatype using an in-memory type that matches the FP8 E4M3 format and perform explicit data conversion outside of HDF5, if necessary. Otherwise, read/written values should be verified to be correct.

◆ H5T_FLOAT_F8E5M2

#define H5T_FLOAT_F8E5M2   (H5OPEN H5T_FLOAT_F8E5M2_g)

8-bit FP8 E5M2 (5 exponent bits, 2 mantissa bits) floating-point numbers

Attention
Implicit datatype conversion should currently be avoided when using this datatype for I/O operations. Incomplete handling of non-IEEE floating-point formats in HDF5 can cause certain FP8 E5M2 values to be improperly converted to Infinities or NaN values. If possible, an application should perform I/O with this datatype using an in-memory type that matches the FP8 E5M2 format and perform explicit data conversion outside of HDF5, if necessary. Otherwise, read/written values should be verified to be correct.