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

Method WriteComplex64

msgp/write.go:561–571  ·  view source on GitHub ↗

WriteComplex64 writes a complex64 to the writer

(f complex64)

Source from the content-addressed store, hash-verified

559
560// WriteComplex64 writes a complex64 to the writer
561func (mw *Writer) WriteComplex64(f complex64) error {
562 o, err := mw.require(10)
563 if err != nil {
564 return err
565 }
566 mw.buf[o] = mfixext8
567 mw.buf[o+1] = Complex64Extension
568 big.PutUint32(mw.buf[o+2:], math.Float32bits(real(f)))
569 big.PutUint32(mw.buf[o+6:], math.Float32bits(imag(f)))
570 return nil
571}
572
573// WriteComplex128 writes a complex128 to the writer
574func (mw *Writer) WriteComplex128(f complex128) error {

Callers 6

TestReadComplex64BytesFunction · 0.95
TestReadComplex64Function · 0.95
WriteIntfMethod · 0.95
TestUnmarshalJSONFunction · 0.95

Calls 1

requireMethod · 0.95

Tested by 5

TestReadComplex64BytesFunction · 0.76
TestReadComplex64Function · 0.76
TestUnmarshalJSONFunction · 0.76