mirror of
https://github.com/shopspring/decimal.git
synced 2024-11-25 05:40:49 +01:00
Compare commits
No commits in common. "20bfa00fcdc5b304cae08d1f5d859d972681694b" and "d538aec685f133c814cedca428ddbb97f134c4d2" have entirely different histories.
20bfa00fcd
...
d538aec685
2 changed files with 1 additions and 2 deletions
|
@ -1231,7 +1231,6 @@ func (d Decimal) NumDigits() int {
|
|||
|
||||
if d.value.IsInt64() {
|
||||
i64 := d.value.Int64()
|
||||
// restrict fast path to integers with exact conversion to float64
|
||||
if i64 <= (1<<53) && i64 >= -(1<<53) {
|
||||
if i64 == 0 {
|
||||
return 1
|
||||
|
|
|
@ -125,7 +125,7 @@ func numDigits(b *testing.B, want int, val Decimal) {
|
|||
b.Helper()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if have := val.NumDigits(); have != want {
|
||||
b.Fatalf("\nHave: %d\nWant: %d", have, want)
|
||||
b.Fatalf("\nHave: %q\nWant: %q", have, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue