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

Function AppendComplex128

msgp/write_bytes.go:306–313  ·  view source on GitHub ↗

AppendComplex128 appends a complex128 to the slice as a MessagePack extension

(b []byte, c complex128)

Source from the content-addressed store, hash-verified

304
305// AppendComplex128 appends a complex128 to the slice as a MessagePack extension
306func AppendComplex128(b []byte, c complex128) []byte {
307 o, n := ensure(b, Complex128Size)
308 o[n] = mfixext16
309 o[n+1] = Complex128Extension
310 big.PutUint64(o[n+2:], math.Float64bits(real(c)))
311 big.PutUint64(o[n+10:], math.Float64bits(imag(c)))
312 return o
313}
314
315// AppendTime appends a time.Time to the slice as a MessagePack extension
316func AppendTime(b []byte, t time.Time) []byte {

Callers 3

BenchmarkReadComplex128Function · 0.85
AppendIntfFunction · 0.85

Calls 1

ensureFunction · 0.70

Tested by 2

BenchmarkReadComplex128Function · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…