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

Method WriteComplex128

msgp/write.go:574–584  ·  view source on GitHub ↗

WriteComplex128 writes a complex128 to the writer

(f complex128)

Source from the content-addressed store, hash-verified

572
573// WriteComplex128 writes a complex128 to the writer
574func (mw *Writer) WriteComplex128(f complex128) error {
575 o, err := mw.require(18)
576 if err != nil {
577 return err
578 }
579 mw.buf[o] = mfixext16
580 mw.buf[o+1] = Complex128Extension
581 big.PutUint64(mw.buf[o+2:], math.Float64bits(real(f)))
582 big.PutUint64(mw.buf[o+10:], math.Float64bits(imag(f)))
583 return nil
584}
585
586// WriteMapStrStr writes a map[string]string to the writer
587func (mw *Writer) WriteMapStrStr(mp map[string]string) (err error) {

Callers 6

TestReadComplex128BytesFunction · 0.95
TestReadComplex128Function · 0.95
TestSkipFunction · 0.95
WriteIntfMethod · 0.95

Calls 1

requireMethod · 0.95

Tested by 5

TestReadComplex128BytesFunction · 0.76
TestReadComplex128Function · 0.76
TestSkipFunction · 0.76