Skip to content

Commit 34c49f3

Browse files
committed
eliminate nested COALTON use in num macros
1 parent da4deab commit 34c49f3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

library/math/num-defining-macros.lisp

+3-3
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204

205205

206206
;;; Float Num instances.
207-
(cl:defmacro define-num-float (type lisp-type)
207+
(cl:defmacro define-num-float (type lisp-type plus-inf minus-inf)
208208
"Define `Num' for the float type TYPE."
209209

210210
;;
@@ -244,8 +244,8 @@
244244
(lisp ,type (x)
245245
(cl:or (cl:ignore-errors (cl:coerce x ',lisp-type))
246246
(cl:if (cl:< x 0)
247-
(coalton (the ,type negative-infinity))
248-
(coalton (the ,type infinity))))))))
247+
,minus-inf
248+
,plus-inf))))))
249249

250250

251251
;;; Utility to define type -> Fraction conversions.

library/math/num.lisp

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@
106106
;;; Float Num instances
107107
;;;
108108

109-
(define-num-float Single-Float cl:single-float)
110-
(define-num-float Double-Float cl:double-float)
109+
(define-num-float Single-Float cl:single-float float-features:single-float-positive-infinity float-features:single-float-negative-infinity)
110+
(define-num-float Double-Float cl:double-float float-features:double-float-positive-infinity float-features:double-float-negative-infinity)
111111

112112

113113
;;;

0 commit comments

Comments
 (0)