MCPcopy
hub / github.com/tinylib/msgp / ReadComplex128

Method ReadComplex128

msgp/read.go:1345–1363  ·  view source on GitHub ↗

ReadComplex128 reads a complex128 from the reader

()

Source from the content-addressed store, hash-verified

1343
1344// ReadComplex128 reads a complex128 from the reader
1345func (m *Reader) ReadComplex128() (f complex128, err error) {
1346 var p []byte
1347 p, err = m.R.Peek(18)
1348 if err != nil {
1349 return
1350 }
1351 if p[0] != mfixext16 {
1352 err = badPrefix(Complex128Type, p[0])
1353 return
1354 }
1355 if int8(p[1]) != Complex128Extension {
1356 err = errExt(int8(p[1]), Complex128Extension)
1357 return
1358 }
1359 f = complex(math.Float64frombits(big.Uint64(p[2:])),
1360 math.Float64frombits(big.Uint64(p[10:])))
1361 _, err = m.R.Skip(18)
1362 return
1363}
1364
1365// ReadMapStrIntf reads a MessagePack map into a map[string]interface{}.
1366// (You must pass a non-nil map into the function.)

Callers 4

TestReadComplex128Function · 0.95
BenchmarkReadComplex128Function · 0.95
FuzzReaderFunction · 0.95
ReadIntfMethod · 0.95

Calls 3

badPrefixFunction · 0.85
errExtFunction · 0.85
SkipMethod · 0.80

Tested by 3

TestReadComplex128Function · 0.76
BenchmarkReadComplex128Function · 0.76
FuzzReaderFunction · 0.76