- fixed a silly bug in (/ <bignum> x/y) which evaluated to
(/ (* <bignum> x) y) instead of (/ (* <bignum> y) x).
This commit is contained in:
parent
69d573a54f
commit
7b32940d04
|
@ -1268,7 +1268,7 @@
|
|||
(quotient y g))))]))]
|
||||
[(flonum? y) ($fl/ (bignum->flonum x) y)]
|
||||
[(ratnum? y)
|
||||
(binary/ (binary* x ($ratnum-n y)) ($ratnum-d y))]
|
||||
(binary/ (binary* x ($ratnum-d y)) ($ratnum-n y))]
|
||||
[(or (compnum? y) (cflonum? y)) (x/compy x y)]
|
||||
[else (err '/ y)])]
|
||||
[(ratnum? x)
|
||||
|
|
|
@ -1 +1 @@
|
|||
1632
|
||||
1633
|
||||
|
|
|
@ -4,9 +4,15 @@
|
|||
(import (ikarus))
|
||||
|
||||
(define (run-tests)
|
||||
(test-/)
|
||||
(test-div-and-mod)
|
||||
(test-div0-and-mod0))
|
||||
|
||||
|
||||
(define (test-/)
|
||||
(assert (= (/ 536870912 1/4) 2147483648)))
|
||||
|
||||
|
||||
(define (test-div-and-mod)
|
||||
(define (test x1 x2)
|
||||
(let-values ([(d m) (div-and-mod x1 x2)])
|
||||
|
|
Loading…
Reference in New Issue