Fix type of expt.

Closes PR 12526.
This commit is contained in:
Vincent St-Amour 2012-02-01 16:38:13 -05:00
parent 87887b7a18
commit 1b6cf730c3
2 changed files with 16 additions and 3 deletions

View File

@ -0,0 +1,13 @@
#;
(
TR missed opt: expt.rkt 13:13 (expt (sin 0.25) 1.0) -- unexpected complex type
TR opt: expt.rkt 13:19 (sin 0.25) -- unary float
)
#lang typed/racket
;; PR 12526
;; result of expt was Float-Complex, and shouldn't have been
;; this let to incorrect optimization
(define (crash)
(real-part (expt (sin 0.25) 1.0)))

View File

@ -1594,11 +1594,11 @@
(-PosReal -Real . -> . -PosReal)
(-NonNegReal -Real . -> . -NonNegReal)
(-Flonum -Integer . -> . -Flonum)
(-Flonum -Real . -> . -FloatComplex)
(-Flonum -Real . -> . N)
(-SingleFlonum -Integer . -> . -SingleFlonum)
(-SingleFlonum -SingleFlonum . -> . -SingleFlonumComplex)
(-SingleFlonum -SingleFlonum . -> . (Un -SingleFlonum -SingleFlonumComplex))
(-InexactReal -Integer . -> . -InexactReal)
(-InexactReal -InexactReal . -> . -InexactComplex)
(-InexactReal -InexactReal . -> . (Un -InexactReal -InexactComplex))
(-ExactNumber -ExactNumber . -> . -ExactNumber)
(commutative-binop N -FloatComplex)
(commutative-binop (Un -ExactNumber -SingleFlonum -SingleFlonumComplex) -SingleFlonumComplex)