On Tuesday, Jan 21, 2003, at 15:54 Europe/London, Ian Zimmerman wrote:
David> Thanks for reporting this. Actually LargeWord is a David> double-precision version of Word (i.e. 60 bits on the Sparc and David> 62 bits on everything else) and there was a silly mistake in David> all the relational operators which meant that the comparison on David> the high order word was reversed. I've fixed it in my copy of David> the source and it will get included in the next release. In David> the meantime if anyone needs the fix I can post the diffs.
Yes, I'll be grateful if you do post the diff.
The file is basis/LargeWord.sml and the diffs are given below. The easiest way to create a fixed version of Poly/ML is probably to download the mlsource and basis sources, edit the file to fix the bug and do a complete rebuild.
David.
Index: basis/LargeWord.sml =================================================================== RCS file: /usr/cvsroot/basis/LargeWord.sml,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -b -w -r1.11 -r1.12 --- basis/LargeWord.sml 28 Feb 2001 12:53:47 -0000 1.11 +++ basis/LargeWord.sml 21 Jan 2003 13:13:20 -0000 1.12 @@ -403,27 +403,27 @@
fun op > ({hi, lo}, {hi=hi', lo=lo'}) = case Word.compare (hi, hi') of - General.GREATER => false + General.GREATER => true | General.EQUAL => Word.>(lo, lo') - | General.LESS => true + | General.LESS => false
and op < ({hi, lo}, {hi=hi', lo=lo'}) = case Word.compare (hi, hi') of - General.GREATER => true + General.GREATER => false | General.EQUAL => Word.<(lo, lo') - | General.LESS => false + | General.LESS => true
and op >= ({hi, lo}, {hi=hi', lo=lo'}) = case Word.compare (hi, hi') of - General.GREATER => false + General.GREATER => true | General.EQUAL => Word.>=(lo, lo') - | General.LESS => true + | General.LESS => false
and op <= ({hi, lo}, {hi=hi', lo=lo'}) = case Word.compare (hi, hi') of - General.GREATER => true + General.GREATER => false | General.EQUAL => Word.<=(lo, lo') - | General.LESS => false + | General.LESS => true
and compare({hi, lo}, {hi=hi', lo=lo'}) = case Word.compare (hi, hi') of