20
0

Fix: reading big integers and some floats

This commit is contained in:
Sergei Lemeshkin 2019-03-05 09:44:52 +03:00 committed by GitHub
parent 6a6d15a25c
commit e0f5c1d7ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
col.go
View File

@ -85,7 +85,7 @@ type RK uint32
func (rk RK) number() (intNum int64, floatNum float64, isFloat bool) { func (rk RK) number() (intNum int64, floatNum float64, isFloat bool) {
multiplied := rk & 1 multiplied := rk & 1
isInt := rk & 2 isInt := rk & 2
val := rk >> 2 val := int32(rk) >> 2
if isInt == 0 { if isInt == 0 {
isFloat = true isFloat = true
floatNum = math.Float64frombits(uint64(val) << 34) floatNum = math.Float64frombits(uint64(val) << 34)