ReadComplex128Bytes reads a complex128 extension object from 'b' and returns the remaining bytes. Possible errors: - [ErrShortBytes] (not enough bytes in 'b') - [TypeError] (object not a complex128) - [InvalidPrefixError] - [ExtensionTypeError] (object an extension of the correct size, but not a c
(b []byte)
| 1020 | // - [InvalidPrefixError] |
| 1021 | // - [ExtensionTypeError] (object an extension of the correct size, but not a complex128) |
| 1022 | func ReadComplex128Bytes(b []byte) (c complex128, o []byte, err error) { |
| 1023 | if len(b) < 18 { |
| 1024 | err = ErrShortBytes |
| 1025 | return |
| 1026 | } |
| 1027 | if b[0] != mfixext16 { |
| 1028 | err = badPrefix(Complex128Type, b[0]) |
| 1029 | return |
| 1030 | } |
| 1031 | if int8(b[1]) != Complex128Extension { |
| 1032 | err = errExt(int8(b[1]), Complex128Extension) |
| 1033 | return |
| 1034 | } |
| 1035 | c = complex(math.Float64frombits(big.Uint64(b[2:])), |
| 1036 | math.Float64frombits(big.Uint64(b[10:]))) |
| 1037 | o = b[18:] |
| 1038 | return |
| 1039 | } |
| 1040 | |
| 1041 | // ReadComplex64Bytes reads a complex64 |
| 1042 | // extension object from 'b' and returns the |
searching dependent graphs…