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

Function AppendComplex64

msgp/write_bytes.go:296–303  ·  view source on GitHub ↗

AppendComplex64 appends a complex64 to the slice as a MessagePack extension

(b []byte, c complex64)

Source from the content-addressed store, hash-verified

294
295// AppendComplex64 appends a complex64 to the slice as a MessagePack extension
296func AppendComplex64(b []byte, c complex64) []byte {
297 o, n := ensure(b, Complex64Size)
298 o[n] = mfixext8
299 o[n+1] = Complex64Extension
300 big.PutUint32(o[n+2:], math.Float32bits(real(c)))
301 big.PutUint32(o[n+6:], math.Float32bits(imag(c)))
302 return o
303}
304
305// AppendComplex128 appends a complex128 to the slice as a MessagePack extension
306func AppendComplex128(b []byte, c complex128) []byte {

Callers 3

BenchmarkReadComplex64Function · 0.85
AppendIntfFunction · 0.85

Calls 1

ensureFunction · 0.70

Tested by 2

BenchmarkReadComplex64Function · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…