MCPcopy Index your code
hub / github.com/vmihailenco/msgpack / float32

Method float32

decode_number.go:173–187  ·  view source on GitHub ↗
(c byte)

Source from the content-addressed store, hash-verified

171}
172
173func (d *Decoder) float32(c byte) (float32, error) {
174 if c == msgpcode.Float {
175 n, err := d.uint32()
176 if err != nil {
177 return 0, err
178 }
179 return math.Float32frombits(n), nil
180 }
181
182 n, err := d.int(c)
183 if err != nil {
184 return 0, fmt.Errorf("msgpack: invalid code=%x decoding float32", c)
185 }
186 return float32(n), nil
187}
188
189// DecodeFloat64 decodes msgpack float32/64 into Go float64.
190func (d *Decoder) DecodeFloat64() (float64, error) {

Callers 3

DecodeFloat32Method · 0.95
float64Method · 0.95
DecodeInterfaceMethod · 0.95

Calls 2

uint32Method · 0.95
intMethod · 0.95

Tested by

no test coverage detected