WriteComplex128 writes a complex128 to the writer
(f complex128)
| 572 | |
| 573 | // WriteComplex128 writes a complex128 to the writer |
| 574 | func (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 |
| 587 | func (mw *Writer) WriteMapStrStr(mp map[string]string) (err error) { |