Open NoamTD opened 2 months ago
For some added context, we wanted to use Rem to be able to precisely tell if one apd.Decimal number was a multiple of another. We instead ended up with the following code, requiring two apd operations (Quo + Modf) instead of one (Rem):
_, err := apdCtx.Quo(&d, x, y)
if err != nil {
return false, err
}
var frac apd.Decimal
d.Modf(nil, &frac)
return frac.IsZero(), nil
I attempted to run the following test:
I would expect this test to pass, but it fails:
apd.BaseContext.Rem returns
division impossible
, which (I believe) is an incorrect result in this case.