It would be useful to know the precision of converting IEEE binary32 to binary16, if the function can be inlined.
PrecisionFromFloat32 should return Precision without performing the conversion.
Conversions from both Infinity and NaN values will always report PrecisionExact even
if NaN payload or NaN-Quiet-Bit is lost.
If this is too complex to be inlined by Go, then make it an extra return value as part of conversion functions.
// Precision indicates whether the conversion to Float16 is
// exact, inexact, underflow, or overflow.
type Precision int
const (
PrecisionExact Precision = iota
PrecisionInexact
PrecisionUnderflow
PrecisionOverflow
)
func PrecisionFromfloat32(f32 float32) Precision