File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 678678 ;; 0 is both positive and negative because we don't handle signed zero well
679679 (define can-neg (or (= (mpfr-sign (ival-lo-val y)) -1 ) can-zero))
680680 (define can-pos (or (= (mpfr-sign (ival-hi-val y)) 1 ) can-zero))
681+ (define sign-immovable? (and can-neg can-pos (ival-lo-fixed? y) (ival-hi-fixed? y)))
681682 (define err? (or (ival-err? y) xerr?))
682683 (define err (or (ival-err y) xerr))
683684 (match* (can-neg can-pos)
684- [(#t #t ) (ival (rnd 'down epunary bfneg xhi) (rnd 'up epunary bfcopy xhi) err? err)]
685+ [(#t #t )
686+ (define out (ival (rnd 'down epunary bfneg xhi) (rnd 'up epunary bfcopy xhi) err? err))
687+ (if sign-immovable?
688+ out
689+ (ival-mobilize out))]
685690 [(#t #f ) (ival (rnd 'down epunary bfneg xhi) (rnd 'up epunary bfneg xlo) err? err)]
686691 [(#f #t ) (ival xlo xhi err? err)]
687692 [(#f #f )
You can’t perform that action at this time.
0 commit comments