Skip to content

Commit

Permalink
Decimal: fix parse issue in IDec test type
Browse files Browse the repository at this point in the history
0.5 was parsed as octal 05 × 10-1. Fixed by forcing the
(*big.Int).SetString call to use base 10.
  • Loading branch information
db47h committed Jun 1, 2020
1 parent 4addc6f commit 81d67aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion intdec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 81d67aa

Please sign in to comment.