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

Method ReadComplex64

msgp/read.go:1324–1342  ·  view source on GitHub ↗

ReadComplex64 reads a complex64 from the reader

()

Source from the content-addressed store, hash-verified

1322
1323// ReadComplex64 reads a complex64 from the reader
1324func (m *Reader) ReadComplex64() (f complex64, err error) {
1325 var p []byte
1326 p, err = m.R.Peek(10)
1327 if err != nil {
1328 return
1329 }
1330 if p[0] != mfixext8 {
1331 err = badPrefix(Complex64Type, p[0])
1332 return
1333 }
1334 if int8(p[1]) != Complex64Extension {
1335 err = errExt(int8(p[1]), Complex64Extension)
1336 return
1337 }
1338 f = complex(math.Float32frombits(big.Uint32(p[2:])),
1339 math.Float32frombits(big.Uint32(p[6:])))
1340 _, err = m.R.Skip(10)
1341 return
1342}
1343
1344// ReadComplex128 reads a complex128 from the reader
1345func (m *Reader) ReadComplex128() (f complex128, err error) {

Callers 4

TestReadComplex64Function · 0.95
BenchmarkReadComplex64Function · 0.95
FuzzReaderFunction · 0.95
ReadIntfMethod · 0.95

Calls 3

badPrefixFunction · 0.85
errExtFunction · 0.85
SkipMethod · 0.80

Tested by 3

TestReadComplex64Function · 0.76
BenchmarkReadComplex64Function · 0.76
FuzzReaderFunction · 0.76