Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2006-10-30
23:22 • Closed ticket [1585704fff]: Bignum modulo bug plus 7 other changes artifact: 7a5aaa9aac user: dgp
2006-10-27
10:35 • New ticket [1585704fff]. artifact: 41da862578 user: pspjuth

Bignum modulo bug

Closed / Fixed1585704fffffffffffffffffffffffffffffffffCreated 20 years agoUpdated 20 years ago
Descriptionplain2006-10-27 10:35:51
(unix) 49 % info pat
8.5a5
(unix) 50 % expr 5 % 23426342852374562476253472
23426342852374562476253477
(unix) 51 % expr -5 % 23426342852374562476253472
-5

There is an error in sign interpretation
for this special case.

tclExecute.c line 3799:
    if ((l1 > 0) ^ big2.sign) {
should be
    if ((l1 > 0) ^ (big2.sign == MP_ZPOS)) {

Same in line 3847
dgpplain2006-10-30 23:22:01
Logged In: YES 
user_id=80530

right you are.  committing fix
with tests...
Log in (anonymous is fine) to add a comment.