MCPcopy Create free account
hub / github.com/brimdata/super / AppendFloat16

Function AppendFloat16

primitive.go:102–106  ·  view source on GitHub ↗
(zb scode.Bytes, f float32)

Source from the content-addressed store, hash-verified

100type TypeOfFloat16 struct{}
101
102func 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
108func EncodeFloat16(d float32) scode.Bytes {
109 var b [2]byte

Callers 1

EncodeFloat16Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected