MCPcopy Create free account
hub / github.com/PostHog/duckgres / decodeFloat4

Function decodeFloat4

server/types.go:941–947  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

939}
940
941func decodeFloat4(data []byte) (float32, error) {
942 if len(data) < 4 {
943 return 0, fmt.Errorf("insufficient data for float4: got %d bytes, need 4", len(data))
944 }
945 bits := binary.BigEndian.Uint32(data)
946 return math.Float32frombits(bits), nil
947}
948
949func decodeFloat8(data []byte) (float64, error) {
950 if len(data) < 8 {

Callers 3

TestDecodeFloat4Function · 0.85
decodeBinaryCopyFunction · 0.85
decodeBinaryFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestDecodeFloat4Function · 0.68