WriteFloat32 writes float32 with the tag.
(data float32, tag byte)
| 290 | |
| 291 | // WriteFloat32 writes float32 with the tag. |
| 292 | func (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. |
| 303 | func (b *Buffer) WriteFloat64(data float64, tag byte) error { |