From 81d67aa48a1d0ceb66e9607e3f1e43466369e472 Mon Sep 17 00:00:00 2001 From: Denis Bernard Date: Mon, 1 Jun 2020 13:15:57 +0200 Subject: [PATCH] Decimal: fix parse issue in IDec test type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 0.5 was parsed as octal 05 × 10-1. Fixed by forcing the (*big.Int).SetString call to use base 10. --- intdec_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intdec_test.go b/intdec_test.go index c31ca5a..4787d8d 100644 --- a/intdec_test.go +++ b/intdec_test.go @@ -61,7 +61,7 @@ func (z *IDec) SetString(s string) *IDec { z.exp = int32(i - len(s) + 1) s = s[:i] + s[i+1:] } - _, ok := z.mant.SetString(s, 0) + _, ok := z.mant.SetString(s, 10) if !ok { panic("(*IDec).SetString: (*big.Int).SetString failed") }