Fixed a bug with exact complexes.
original commit: 4803eafa6722acfdf0d37dab3782660d22665b84
This commit is contained in:
parent
6473855e45
commit
c625d547ca
|
@ -0,0 +1,5 @@
|
|||
#lang typed/scheme #:optimize
|
||||
|
||||
(require racket/unsafe/ops)
|
||||
|
||||
(+ 1.0+2.0i 2+4i)
|
|
@ -254,11 +254,13 @@
|
|||
#`((real-binding (exact->inexact #,((optimize) #'e)))))
|
||||
(pattern e:expr
|
||||
#:when (isoftype? #'e -Number) ; complex, maybe exact, maybe not
|
||||
#:with e* (unboxed-gensym)
|
||||
#:with real-binding (unboxed-gensym)
|
||||
#:with imag-binding (unboxed-gensym)
|
||||
#:with (bindings ...)
|
||||
#`((real-binding (real-part #,((optimize) #'e)))
|
||||
(imag-binding (imag-part #,((optimize) #'e)))))
|
||||
#`((e* #,((optimize) #'e))
|
||||
(real-binding (exact->inexact (real-part e*)))
|
||||
(imag-binding (exact->inexact (imag-part e*)))))
|
||||
(pattern e:expr
|
||||
#:with (bindings ...)
|
||||
(error "non exhaustive pattern match")
|
||||
|
|
Loading…
Reference in New Issue
Block a user