MCPcopy Create free account
hub / github.com/protocolbuffers/protobuf-go / WriteFloat

Method WriteFloat

internal/encoding/json/encode.go:142–145  ·  view source on GitHub ↗

WriteFloat writes out the given float and bitSize in JSON number value.

(n float64, bitSize int)

Source from the content-addressed store, hash-verified

140
141// WriteFloat writes out the given float and bitSize in JSON number value.
142func (e *Encoder) WriteFloat(n float64, bitSize int) {
143 e.prepareNext(scalar)
144 e.out = appendFloat(e.out, n, bitSize)
145}
146
147// appendFloat formats given float in bitSize, and appends to the given []byte.
148func appendFloat(out []byte, n float64, bitSize int) []byte {

Callers 3

marshalSingularMethod · 0.45
marshalSingularMethod · 0.45
TestEncoderFunction · 0.45

Calls 2

prepareNextMethod · 0.95
appendFloatFunction · 0.70

Tested by 1

TestEncoderFunction · 0.36