ReadComplex64 reads a complex64 from the reader
()
| 1322 | |
| 1323 | // ReadComplex64 reads a complex64 from the reader |
| 1324 | func (m *Reader) ReadComplex64() (f complex64, err error) { |
| 1325 | var p []byte |
| 1326 | p, err = m.R.Peek(10) |
| 1327 | if err != nil { |
| 1328 | return |
| 1329 | } |
| 1330 | if p[0] != mfixext8 { |
| 1331 | err = badPrefix(Complex64Type, p[0]) |
| 1332 | return |
| 1333 | } |
| 1334 | if int8(p[1]) != Complex64Extension { |
| 1335 | err = errExt(int8(p[1]), Complex64Extension) |
| 1336 | return |
| 1337 | } |
| 1338 | f = complex(math.Float32frombits(big.Uint32(p[2:])), |
| 1339 | math.Float32frombits(big.Uint32(p[6:]))) |
| 1340 | _, err = m.R.Skip(10) |
| 1341 | return |
| 1342 | } |
| 1343 | |
| 1344 | // ReadComplex128 reads a complex128 from the reader |
| 1345 | func (m *Reader) ReadComplex128() (f complex128, err error) { |