Files
dependabot[bot] 6a5e3ddc8a chore(deps): bump github.com/shamaton/msgpack/v2 from 2.3.0 to 2.3.1
Bumps [github.com/shamaton/msgpack/v2](https://github.com/shamaton/msgpack) from 2.3.0 to 2.3.1.
- [Release notes](https://github.com/shamaton/msgpack/releases)
- [Commits](https://github.com/shamaton/msgpack/compare/v2.3.0...v2.3.1)

---
updated-dependencies:
- dependency-name: github.com/shamaton/msgpack/v2
  dependency-version: 2.3.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-26 06:03:15 +00:00

28 lines
611 B
Go

package encoding
import (
"math"
"github.com/shamaton/msgpack/v2/def"
)
func (e *encoder) calcFloat32(_ float64) int {
return def.Byte1 + def.Byte4
}
func (e *encoder) calcFloat64(_ float64) int {
return def.Byte1 + def.Byte8
}
func (e *encoder) writeFloat32(v float64, offset int) int {
offset = e.setByte1Int(def.Float32, offset)
offset = e.setByte4Uint64(uint64(math.Float32bits(float32(v))), offset)
return offset
}
func (e *encoder) writeFloat64(v float64, offset int) int {
offset = e.setByte1Int(def.Float64, offset)
offset = e.setByte8Uint64(math.Float64bits(v), offset)
return offset
}