Fixes bug 191116: rationalize broken
This commit is contained in:
parent
755843e251
commit
db54cd0074
|
@ -2710,11 +2710,11 @@
|
|||
(- (simplest^ (- n^) d^ (- n) d)))]
|
||||
[else 1]))
|
||||
(define (simplest^ n d n^ d^)
|
||||
(let-values ([(q r) (quotient+remainder n d)])
|
||||
(let-values ([(q r) (div-and-mod n d)])
|
||||
(if (= r 0)
|
||||
q
|
||||
(let-values ([(q^ r^) (quotient+remainder n^ d^)])
|
||||
(if (= q q^)
|
||||
(let-values ([(q^ r^) (div-and-mod n^ d^)])
|
||||
(if (= q q^)
|
||||
(let ([v (simplest^ d^ r^ d r)])
|
||||
(let ([n^^ (numerator v)] [d^^ (denominator v)])
|
||||
(/ (+ (* q n^^) d^^) n^^)))
|
||||
|
|
|
@ -1 +1 @@
|
|||
1406
|
||||
1407
|
||||
|
|
Loading…
Reference in New Issue