* Fixed bug 160101: modulo produces "BUG: unsupported"

This commit is contained in:
Abdulaziz Ghuloum 2007-11-05 02:24:39 -05:00
parent 6b40f525d9
commit 90a243ee63
3 changed files with 19 additions and 17 deletions

View File

@ -1240,10 +1240,17 @@
[(fixnum? m)
(foreign-call "ikrt_bnfx_modulo" n m)]
[(bignum? m)
(error 'modulo
"BUG: two bignum arguments are not yet implemented"
n m)
(foreign-call "ikrt_bnbn_modulo" n m)]
(if ($bignum-positive? n)
(if ($bignum-positive? m)
(remainder n m)
(+ m (remainder n m)))
(if ($bignum-positive? m)
(+ m (remainder n m))
(remainder n m)))]
;(error 'modulo
; "BUG: two bignum arguments are not yet implemented"
; n m)
;(foreign-call "ikrt_bnbn_modulo" n m)]
[(flonum? m)
(let ([v ($flonum->exact m)])
(cond

View File

@ -82,14 +82,14 @@
[(lambda (x) (= x -116479))
(modulo -536870912238479837489374 -324873)]
; then make both arguments bignums
;[(lambda (x) (= x 830066489308918857679))
; (modulo 536870912238479837489374 3248732398479823749283)]
;[(lambda (x) (= x 2418665909170904891604))
; (modulo -536870912238479837489374 3248732398479823749283)]
;[(lambda (x) (= x -2418665909170904891604))
; (modulo 536870912238479837489374 -3248732398479823749283)]
;[(lambda (x) (= x -830066489308918857679))
; (modulo -536870912238479837489374 -3248732398479823749283)]
[(lambda (x) (= x 830066489308918857679))
(modulo 536870912238479837489374 3248732398479823749283)]
[(lambda (x) (= x -2418665909170904891604))
(modulo 536870912238479837489374 -3248732398479823749283)]
[(lambda (x) (= x 2418665909170904891604))
(modulo -536870912238479837489374 3248732398479823749283)]
[(lambda (x) (= x -830066489308918857679))
(modulo -536870912238479837489374 -3248732398479823749283)]
))

View File

@ -1464,11 +1464,6 @@ ikrt_bnfx_modulo(ikp x, ikp y, ikpcb* pcb){
}
}
ikp
ikrt_bnbn_modulo(ikp x, ikp y, ikpcb* pcb){
fprintf(stderr, "error in bnbnmodulo\n");
exit(-1);
}