Skip to content

Commit

Permalink
Fix interval-intersect for degenerate axes.
Browse files Browse the repository at this point in the history
Closes #984.
  • Loading branch information
ashinn committed May 29, 2024
1 parent 609c78c commit e737e48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/srfi/231/base.scm
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
(or (null? o) (apply = (map interval-dimension ls)))))
(let ((lower (apply vector-map max (map interval-lb ls)))
(upper (apply vector-map min (map interval-ub ls))))
(and (vector-every < lower upper)
(and (vector-every <= lower upper)
(make-interval lower upper)))))

(define (interval-translate iv translation)
Expand Down
5 changes: 4 additions & 1 deletion lib/srfi/231/test.sld
Original file line number Diff line number Diff line change
Expand Up @@ -2864,7 +2864,10 @@
(c (make-interval '#(10 10) '#(20 20))))
(test-error (interval-intersect 'a))
(test-error (interval-intersect a 'a))
(test-error (interval-intersect a b)))
(test-error (interval-intersect a b))
(test-assert (interval-intersect a))
(test-assert
(interval-intersect (make-interval '#(6 -9 -6) '#(6 -5 -3)))))

(do ((i 0 (+ i 1)))
((= i tests))
Expand Down

0 comments on commit e737e48

Please sign in to comment.