MCPcopy
hub / github.com/ugorji/go / encodeComplex128

Method encodeComplex128

codec/encode.go:220–225  ·  view source on GitHub ↗
(v complex128)

Source from the content-addressed store, hash-verified

218}
219
220func (e *Encoder) encodeComplex128(v complex128) {
221 if imag(v) != 0 {
222 e.errorf("cannot encode complex number: %v, with imaginary values: %v", v, imag(v))
223 }
224 e.e.EncodeFloat64(real(v))
225}
226
227func (e *Encoder) kBool(f *codecFnInfo, rv reflect.Value) {
228 e.e.EncodeBool(rvGetBool(rv))

Callers 3

kComplex128Method · 0.95
encodeMethod · 0.95
EncEncodeComplex128Method · 0.80

Calls 2

errorfMethod · 0.80
EncodeFloat64Method · 0.65

Tested by

no test coverage detected