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