WriteComplex64 writes a complex64 to the writer
(f complex64)
| 559 | |
| 560 | // WriteComplex64 writes a complex64 to the writer |
| 561 | func (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 |
| 574 | func (mw *Writer) WriteComplex128(f complex128) error { |