MCPcopy Index your code
hub / github.com/expr-lang/expr / printComplex

Function printComplex

internal/spew/common.go:170–181  ·  view source on GitHub ↗

printComplex outputs a complex value using the specified float precision for the real and imaginary parts to Writer w.

(w io.Writer, c complex128, floatPrecision int)

Source from the content-addressed store, hash-verified

168// printComplex outputs a complex value using the specified float precision
169// for the real and imaginary parts to Writer w.
170func printComplex(w io.Writer, c complex128, floatPrecision int) {
171 r := real(c)
172 w.Write(openParenBytes)
173 w.Write([]byte(strconv.FormatFloat(r, 'g', -1, floatPrecision)))
174 i := imag(c)
175 if i >= 0 {
176 w.Write(plusBytes)
177 }
178 w.Write([]byte(strconv.FormatFloat(i, 'g', -1, floatPrecision)))
179 w.Write(iBytes)
180 w.Write(closeParenBytes)
181}
182
183// printHexPtr outputs a uintptr formatted as hexadecimal with a leading '0x'
184// prefix to Writer w.

Callers 2

formatMethod · 0.85
dumpMethod · 0.85

Calls 1

WriteMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…