Skip to content

Commit

Permalink
Update dec.go
Browse files Browse the repository at this point in the history
  • Loading branch information
samricotta committed Jul 1, 2024
1 parent caec90d commit c3fe8ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions math/dec.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (x Dec) Quo(y Dec) (Dec, error) {
var z Dec
_, err := dec128Context.Quo(&z.dec, &x.dec, &y.dec)
if err != nil {
return Dec{}, ErrInvalidDec
return Dec{}, ErrInvalidDec.Wrap(err.Error())
}

return z, errors.Wrap(err, "decimal quotient error")
Expand All @@ -168,7 +168,7 @@ func (x Dec) QuoExact(y Dec) (Dec, error) {
var z Dec
condition, err := dec128Context.Quo(&z.dec, &x.dec, &y.dec)
if err != nil {
return z, ErrInvalidDec
return z, ErrInvalidDec.Wrap(err.Error())
}
if condition.Rounded() {
return z, ErrUnexpectedRounding
Expand All @@ -182,7 +182,7 @@ func (x Dec) QuoInteger(y Dec) (Dec, error) {
var z Dec
_, err := dec128Context.QuoInteger(&z.dec, &x.dec, &y.dec)
if err != nil {
return z, ErrInvalidDec
return z, ErrInvalidDec.Wrap(err.Error())
}
return z, nil
}
Expand Down

0 comments on commit c3fe8ba

Please sign in to comment.