MCPcopy
hub / github.com/pquerna/ffjson / fmtB

Function fmtB

fflib/v1/ftoa.go:426–446  ·  view source on GitHub ↗

%b: -ddddddddp±ddd

(dst EncodingBuffer, neg bool, mant uint64, exp int, flt *floatInfo)

Source from the content-addressed store, hash-verified

424
425// %b: -ddddddddp±ddd
426func fmtB(dst EncodingBuffer, neg bool, mant uint64, exp int, flt *floatInfo) {
427 // sign
428 if neg {
429 dst.WriteByte('-')
430 }
431
432 // mantissa
433 formatBits(dst, mant, 10, false)
434
435 // p
436 dst.WriteByte('p')
437
438 // ±exponent
439 exp -= int(flt.mantbits)
440 if exp >= 0 {
441 dst.WriteByte('+')
442 }
443 formatBits(dst, uint64(exp), 10, exp < 0)
444
445 return
446}
447
448func min(a, b int) int {
449 if a < b {

Callers 1

AppendFloatFunction · 0.70

Calls 2

formatBitsFunction · 0.85
WriteByteMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…