Skip to content

Commit 8bd9480

Browse files
committed
Skip mk-big-ival entirely
1 parent f7195c1 commit 8bd9480

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

ops/core.rkt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
[(_me name lo hi) #'(and name (ival (endpoint lo _) (endpoint hi _) _ _))]))
9898
(λ (stx)
9999
(syntax-case stx ()
100-
[(_ lo) #'(mk-big-ival lo lo)]
100+
[(_ lo) #'(mk-ival lo)]
101101
[(_ lo hi) #'(mk-big-ival lo hi)])))
102102

103103
(struct endpoint (val immovable?) #:transparent)
@@ -126,9 +126,6 @@
126126

127127
(define (mk-big-ival x y)
128128
(cond
129-
[(eq? x y)
130-
(define err? (and (bigfloat? x) (not (bfrational? x))))
131-
(ival (endpoint x #t) (endpoint x #t) err? err?)]
132129
[(and (bigfloat? x) (bigfloat? y))
133130
(define fix? (bf=? x y))
134131
(define err? (or (bfnan? x) (bfnan? y) (and (bfinfinite? x) fix?)))
@@ -139,7 +136,9 @@
139136
[else (error 'ival "Invalid interval endpoints" x y)]))
140137

141138
(define (mk-ival x)
142-
(mk-big-ival x x))
139+
(define err? (and (bigfloat? x) (not (bfrational? x))))
140+
(define ep (endpoint x #t))
141+
(ival ep ep err? err?))
143142

144143
(define (and-fn . as)
145144
(andmap identity as))

0 commit comments

Comments
 (0)