Closed jordanlewis closed 2 years ago
The correct way of checking whether a decimal is zero is comparing Sign
with zero as it handles the case where the decimal is an infinity or NaN. isZero
doesn’t perform those checks.
I am not necessarily opposed to adding func (x *Big) IsZero() bool { return x.Sign() == 0 }
.
since there are conflicts, i'm going to close this for now. But if you feel strongly about IsZero vs Sign then I'll be glad to re-open it.
IsZero is a very handy method. It's often convenient to know whether a decimal is zero or not. Make it public for outside use.