C-language half-float Conversion¶
The half.h
header can be included in pure C code:
#include <Imath/half.h>
void
half_example()
{
float f = 3.5f;
half h = imath_float_to_half (f)
float hh = imath_half_to_float (h)
}
The only C-language operations supported for the half
type are
conversion to and from float
. No arithmetic operations are
currently implemented in the C interface.
-
static float
imath_half_to_float
(half h)¶ Convert half to float.
-
static float
imath_half_to_float
(half h) Convert half to float.