Ensure that we coerce to double flonums.
This commit is contained in:
parent
7c945d36c0
commit
2076199838
|
@ -316,8 +316,8 @@
|
||||||
#:with (real-binding imag-binding) (binding-names)
|
#:with (real-binding imag-binding) (binding-names)
|
||||||
#:do [(log-unboxing-opt "unboxed literal")]
|
#:do [(log-unboxing-opt "unboxed literal")]
|
||||||
#:with (bindings ...)
|
#:with (bindings ...)
|
||||||
#`(((real-binding) '#,(exact->inexact (real-part n)))
|
#`(((real-binding) '#,(real->double-flonum (real-part n)))
|
||||||
((imag-binding) '#,(exact->inexact (imag-part n)))))
|
((imag-binding) '#,(real->double-flonum (imag-part n)))))
|
||||||
(pattern (quote n*:number)
|
(pattern (quote n*:number)
|
||||||
#:do [(define n (syntax->datum #'n*))]
|
#:do [(define n (syntax->datum #'n*))]
|
||||||
#:when (real? n)
|
#:when (real? n)
|
||||||
|
@ -325,7 +325,7 @@
|
||||||
#:with imag-binding #'0.0
|
#:with imag-binding #'0.0
|
||||||
#:do [(log-unboxing-opt "unboxed literal")]
|
#:do [(log-unboxing-opt "unboxed literal")]
|
||||||
#:with (bindings ...)
|
#:with (bindings ...)
|
||||||
#`(((real-binding) '#,(exact->inexact n))))
|
#`(((real-binding) '#,(real->double-flonum n))))
|
||||||
|
|
||||||
(pattern e:float-complex-expr
|
(pattern e:float-complex-expr
|
||||||
#:with e* (generate-temporary)
|
#:with e* (generate-temporary)
|
||||||
|
@ -342,8 +342,8 @@
|
||||||
#:do [(log-unboxing-opt "unbox complex")]
|
#:do [(log-unboxing-opt "unbox complex")]
|
||||||
#:with (bindings ...)
|
#:with (bindings ...)
|
||||||
#'(((e*) e.opt)
|
#'(((e*) e.opt)
|
||||||
((real-binding) (exact->inexact (real-part e*)))
|
((real-binding) (real->double-flonum (real-part e*)))
|
||||||
((imag-binding) (exact->inexact (imag-part e*)))))
|
((imag-binding) (real->double-flonum (imag-part e*)))))
|
||||||
(pattern e:expr
|
(pattern e:expr
|
||||||
#:do [(error (format "non exhaustive pattern match ~a" #'e))]
|
#:do [(error (format "non exhaustive pattern match ~a" #'e))]
|
||||||
#:with (bindings ...) (list)
|
#:with (bindings ...) (list)
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
(pattern (quote n)
|
(pattern (quote n)
|
||||||
#:when (and (real? (syntax->datum #'n))
|
#:when (and (real? (syntax->datum #'n))
|
||||||
(exact? (syntax->datum #'n)))
|
(exact? (syntax->datum #'n)))
|
||||||
#:with opt #`'#,(exact->inexact (syntax->datum #'n)))
|
#:with opt #`'#,(real->double-flonum (syntax->datum #'n)))
|
||||||
(pattern e:fixnum-expr
|
(pattern e:fixnum-expr
|
||||||
#:attr opt (delay #'(unsafe-fx->fl e.opt)))
|
#:attr opt (delay #'(unsafe-fx->fl e.opt)))
|
||||||
(pattern e:int-expr
|
(pattern e:int-expr
|
||||||
|
|
Loading…
Reference in New Issue
Block a user