|
|
|
@ -112,6 +112,13 @@ func (this *Decoder) ReadUintN(bytes int) (value uint64, n int, err error) {
|
|
|
|
return value, n, nil
|
|
|
|
return value, n, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ReadFloat16 decodes a 16-bit floating point value from the input reader.
|
|
|
|
|
|
|
|
func (this *Decoder) ReadFloat16() (value float32, n int, err error) {
|
|
|
|
|
|
|
|
bits, nn, err := this.ReadUint16()
|
|
|
|
|
|
|
|
n += nn; if err != nil { return 0, n, err }
|
|
|
|
|
|
|
|
return math.Float32frombits(f16bitsToF32bits(bits)), n, nil
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ReadFloat32 decldes a 32-bit floating point value from the input reader.
|
|
|
|
// ReadFloat32 decldes a 32-bit floating point value from the input reader.
|
|
|
|
func (this *Decoder) ReadFloat32() (value float32, n int, err error) {
|
|
|
|
func (this *Decoder) ReadFloat32() (value float32, n int, err error) {
|
|
|
|
bits, nn, err := this.ReadUint32()
|
|
|
|
bits, nn, err := this.ReadUint32()
|
|
|