Re: More on integer division

2002-07-04 Thread Alastair Reid
[Mail I send to Dylan tends to bounce so I'm using both email addresses I have for him and hoping that he's subscribed to ghc-bugs in case both of those addresses fail...] Dylan Thurston [EMAIL PROTECTED] writes: Ken Shan told me about QuickCheck, which seems like the right way to test such

RE: More on integer division

2002-07-02 Thread Simon Marlow
Send us improved testsuites and we'll happily add them to our suites. The most relevant Hugs testsuites are: intTest.{hs,input,output} This one appears to have a common ancestry with arith011 in fptools/testsuite/tests/ghc-regress/numeric/should_run. However arith011 has grown a bit

RE: More on integer division

2002-07-01 Thread Simon Marlow
After a looking a little more, there seem to be other problems (including errors in my proposed solution). I don't know where the code for quotRem is, but it is also buggy. For instance, Prelude 9 `quotRem` (-5) (-1,4) (The correct answer is (-1,-4).) I'm frankly astonished: has

RE: More on integer division

2002-07-01 Thread Simon Marlow
I'm shocked that non of the three Haskell implementations had a test suite that caught this problem. Take a look at fptools/testsuite/tests/ghc-regress/numeric/should_run/arith0011.hs. There may be one or two wrong answers lurking in there, but that's a lot of results to check by

Re: More on integer division

2002-07-01 Thread Alastair Reid
However, it's easy to write a program to verify such results, assuming you trust your addition and multiplication and comparisons: [...] Also, looking at arith003, there are a few more test cases I might include, with quotient/remainder, say, 3/4 or 1/2 of maxInt. You also don't seem to