Fix bug in unsigned modular arithmetic using a signed implementation
If we aim to be clever by implementing an unsigned modular arithmetic
computation using signed arithmetic, we need to make sure that we
don't accidentally contaminate the computation with any extraneous
high bits. This means that we must be sure to cut constants to the
appropriate width, as well as computations, so do so; this fixes bug #974406 from Paul Dietz. (In addition the change from cutting
to the requested width to the implementation width fixes #903821,
so Go Team!)
Test cases. Minimally horrible test case for #903821; far worse
suggestions were made on #sbcl IRC...
Christophe Rhodes <email address hidden> writes:
status fixcommitted
done
commit 52b1041d3a14eaa 4e45f6d8edfbdc0 dec4292239
Author: Christophe Rhodes <email address hidden>
Date: Thu Apr 5 19:55:05 2012 +0100
Fix bug in unsigned modular arithmetic using a signed implementation
If we aim to be clever by implementing an unsigned modular arithmetic
computation using signed arithmetic, we need to make sure that we
don't accidentally contaminate the computation with any extraneous
high bits. This means that we must be sure to cut constants to the
appropriate width, as well as computations, so do so; this fixes
bug #974406 from Paul Dietz. (In addition the change from cutting
to the requested width to the implementation width fixes #903821,
so Go Team!)
Test cases. Minimally horrible test case for #903821; far worse
suggestions were made on #sbcl IRC...