Thanks, Phil. I've fixed it in CVS and added these tests to my regression tests.
David
Philip Clayton wrote:
In my ignorance I wrote my own exponentiation function for infinite integers, only to find IntInf.pow exists in the basis. Anyway, I ran my test cases on IntInf.pow but they didn't all pass...
The following tests should be true but return false:
val test = IntInf.pow; test (~1, ~1000000) = 1; test (~1, ~8) = 1; test (~1, ~6) = 1; test (~1, ~4) = 1; test (~1, ~2) = 1; test (~1, ~1) = ~1;
It looks like Int.quot(j, 2) on line 117 of basis/IntInf.sml should be Int.rem(j, 2) or possibly andb(j, 1) (as in the local function power).
Phil