(zb scode.Bytes, f float32)
| 100 | type TypeOfFloat16 struct{} |
| 101 | |
| 102 | func AppendFloat16(zb scode.Bytes, f float32) scode.Bytes { |
| 103 | buf := make([]byte, 2) |
| 104 | binary.LittleEndian.PutUint16(buf, float16.Fromfloat32(f).Bits()) |
| 105 | return append(zb, buf...) |
| 106 | } |
| 107 | |
| 108 | func EncodeFloat16(d float32) scode.Bytes { |
| 109 | var b [2]byte |