You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The exponent doesn't really matter when it comes to zero values, if you look at the implementation of the IsZero method, you'll see that it returns d.Sign() == 0, where sign can either be -1 or +1 for positive/negative numbers, and 0 for zero. As for the question about zero being possibly defined as Decimal{}: the nil value of the Decimal type is zero, which you can easily check like so:
d:= shopspring.Decimal{}
fmt.Println(d.IsZero()) // prints true
I'm interested in the design decision just for curiosity.
Also, if
, can't it be defined as
Decimal{}
?The text was updated successfully, but these errors were encountered: