mirror of
https://github.com/shopspring/decimal.git
synced 2024-11-25 05:40:49 +01:00
comment on significance of 53 bit significand
This commit is contained in:
parent
445700e706
commit
20bfa00fcd
1 changed files with 1 additions and 0 deletions
|
@ -1231,6 +1231,7 @@ func (d Decimal) NumDigits() int {
|
||||||
|
|
||||||
if d.value.IsInt64() {
|
if d.value.IsInt64() {
|
||||||
i64 := d.value.Int64()
|
i64 := d.value.Int64()
|
||||||
|
// restrict fast path to integers with exact conversion to float64
|
||||||
if i64 <= (1<<53) && i64 >= -(1<<53) {
|
if i64 <= (1<<53) && i64 >= -(1<<53) {
|
||||||
if i64 == 0 {
|
if i64 == 0 {
|
||||||
return 1
|
return 1
|
||||||
|
|
Loading…
Reference in a new issue