Skip to content

Commit 7e0cdb5

Browse files
committed
Fix tunnel-visioned code
1 parent 7e4ee4f commit 7e0cdb5

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

ops/core.rkt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -419,11 +419,8 @@
419419
[(-1 1) (mkatan yhi xhi ylo xlo)]
420420
[(_ 0)
421421
(define pi-int (ival-pi))
422-
(define-values (hi-out lo-out) (make-endpoint-pair))
423-
(mpfr-set! hi-out (endpoint-val (ival-hi pi-int)) 'up)
424-
(mpfr-neg! lo-out (endpoint-val (ival-hi pi-int)) 'down)
425-
(ival (endpoint lo-out #f)
426-
(endpoint hi-out #f)
422+
(ival (ival-lo (ival-neg pi-int))
423+
(ival-hi pi-int)
427424
(or err? (bfgte? (ival-hi-val x) 0.bf))
428425
(or err
429426
(and (bfzero? (ival-lo-val x))

ops/fmod.rkt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@
109109
;; Use ival-fabs and ival-neg without the precision-changing wrappers
110110
(define y* (ival-fabs y))
111111
(cond
112-
[(= (mpfr-sign (ival-hi-val x)) -1)
113-
(ival-neg (ival-remainder-pos (ival-neg x) y* err? err))]
112+
[(= (mpfr-sign (ival-hi-val x)) -1) (ival-neg (ival-remainder-pos (ival-neg x) y* err? err))]
114113
[(= (mpfr-sign (ival-lo-val x)) 1) (ival-remainder-pos x y* err? err)]
115114
[else
116115
(define-values (neg pos) (split-ival x 0.bf))

0 commit comments

Comments
 (0)