// ToFloat16Checked attempts to cast the Float32 to a Float16.
// The second return value will be false if there was an overflow or any other loss of precision.
// For example, going from Float64 to Int64 will result in anything after the decimal being truncated.
ToFloat16Checked attempts to cast the Float32 to a Float16.
The second return value will be false if there was an overflow or any other loss of precision.
For example, going from Float64 to Int64 will result in anything after the decimal being truncated.
// ToFloat16Checked attempts to cast the Float32 to a Float16 . // The second return value will be false if there was an overflow or any other loss of precision . // For example going from Float64 to Int64 will result in anything after the decimal being truncated .
func (t Float32) ToFloat16Checked() (Float16, Boolean) {
	var converted Float16
	converted = Float16(float16.New(float32(t)))
	v, err := converted.ToFloat32().Eq(t)
	return converted, Boolean(err == nil && v)
}
func ( t Float32 ) ToFloat16Checked ( ) ( Float16 , Boolean ) { var converted Float16 converted = Float16 ( float16 . New ( float32 ( t ) ) ) v , err := converted . ToFloat32 ( ) . Eq ( t ) return converted , Boolean ( err == nil && v ) }
ToFloat16Checked attempts to cast the Float32 to a Float16.
ToFloat16Checked attempts to cast the Float32 to a Float16 .