Ensure that we coerce to double flonums.

original commit: 2076199838a8de2527ba241ef8e564ae5cfd385a
This commit is contained in:
Eric Dobson 2013-10-29 23:40:01 -07:00
parent 9ae20f77b8
commit 90d9b12f26
2 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

@ -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