MCPcopy Index your code
hub / github.com/tinylib/msgp / ReadComplex128Bytes

Function ReadComplex128Bytes

msgp/read_bytes.go:1022–1039  ·  view source on GitHub ↗

ReadComplex128Bytes reads a complex128 extension object from 'b' and returns the remaining bytes. Possible errors: - [ErrShortBytes] (not enough bytes in 'b') - [TypeError] (object not a complex128) - [InvalidPrefixError] - [ExtensionTypeError] (object an extension of the correct size, but not a c

(b []byte)

Source from the content-addressed store, hash-verified

1020// - [InvalidPrefixError]
1021// - [ExtensionTypeError] (object an extension of the correct size, but not a complex128)
1022func ReadComplex128Bytes(b []byte) (c complex128, o []byte, err error) {
1023 if len(b) < 18 {
1024 err = ErrShortBytes
1025 return
1026 }
1027 if b[0] != mfixext16 {
1028 err = badPrefix(Complex128Type, b[0])
1029 return
1030 }
1031 if int8(b[1]) != Complex128Extension {
1032 err = errExt(int8(b[1]), Complex128Extension)
1033 return
1034 }
1035 c = complex(math.Float64frombits(big.Uint64(b[2:])),
1036 math.Float64frombits(big.Uint64(b[10:])))
1037 o = b[18:]
1038 return
1039}
1040
1041// ReadComplex64Bytes reads a complex64
1042// extension object from 'b' and returns the

Callers 3

TestReadComplex128BytesFunction · 0.85
FuzzReadBytesFunction · 0.85
readIntfBytesDepthFunction · 0.85

Calls 2

badPrefixFunction · 0.85
errExtFunction · 0.85

Tested by 2

TestReadComplex128BytesFunction · 0.68
FuzzReadBytesFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…