From 5c4dac2abf8847f9cdf1289030013ad372abe91e Mon Sep 17 00:00:00 2001 From: "chen.s.g" Date: Wed, 13 Jun 2018 14:06:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E8=BD=AC=E6=8D=A2=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- col.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/col.go b/col.go index c3a84d2..b99ca1f 100644 --- a/col.go +++ b/col.go @@ -204,17 +204,17 @@ func (f *FormulaColHeader) Value() float64 { var rknumhigh = ByteToUint32(f.Result[4:8]) var rknumlow = ByteToUint32(f.Result[0:4]) var sign = (rknumhigh & 0x80000000) >> 31 - var exp = ((rknumhigh & 0x7ff00000) >> 20) - 1023 + var exp = float64(((rknumhigh & 0x7ff00000) >> 20) - 1023) var mantissa = (0x100000 | (rknumhigh & 0x000fffff)) var mantissalow1 = (rknumlow & 0x80000000) >> 31 var mantissalow2 = (rknumlow & 0x7fffffff) - var value = float64(mantissa) / math.Pow(2, float64(20-exp)) + var value = float64(mantissa) / math.Pow(2, 20-exp) if mantissalow1 != 0 { - value += 1 / math.Pow(2, float64(21-exp)) + value += 1 / math.Pow(2, 21-exp) } - value += float64(mantissalow2) / math.Pow(2, float64(52-exp)) + value += float64(mantissalow2) / math.Pow(2, 52-exp) if 0 != sign { value *= -1 }