I attempted to run the following test:
func TestRem(t *testing.T) {
a := apd.New(100, 100)
b := apd.New(10, 1)
var rem apd.Decimal
_, err := apd.BaseContext.Rem(&rem, a, b)
if err != nil {
t.Fatal(err)
}
if !rem.IsZero() {
t.Fatal("expected zero")
}
}
I would expect this test to pass, but it fails:
=== RUN TestRem
rem_test.go:72: division impossible
--- FAIL: TestRem (0.00s)
FAIL
apd.BaseContext.Rem returns division impossible, which (I believe) is an incorrect result in this case.
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.