MCPcopy
hub / github.com/TarsCloud/TarsGo / WriteFloat32

Method WriteFloat32

tars/protocol/codec/codec.go:292–300  ·  view source on GitHub ↗

WriteFloat32 writes float32 with the tag.

(data float32, tag byte)

Source from the content-addressed store, hash-verified

290
291// WriteFloat32 writes float32 with the tag.
292func (b *Buffer) WriteFloat32(data float32, tag byte) error {
293 var err error
294 if err = b.WriteHead(FLOAT, tag); err != nil {
295 return err
296 }
297
298 err = bWriteU32(b.buf, math.Float32bits(data))
299 return err
300}
301
302// WriteFloat64 writes float64 with the tag.
303func (b *Buffer) WriteFloat64(data float64, tag byte) error {

Callers 4

TestBuffer_float32Function · 0.95
TestReader_unreadHeadFunction · 0.95
TestReader_SkipToNoCheckFunction · 0.95
putBaseMethod · 0.80

Calls 2

WriteHeadMethod · 0.95
bWriteU32Function · 0.85

Tested by 3

TestBuffer_float32Function · 0.76
TestReader_unreadHeadFunction · 0.76
TestReader_SkipToNoCheckFunction · 0.76