From 783b505c9dc0282426098b8a44705385f643837c Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Mon, 28 Jun 2010 11:04:44 -0400 Subject: [PATCH] Eliminate exact->inexact of floats. original commit: a6872c67a74e5d65a8a68b7fd5daa16b4225efe9 --- collects/typed-scheme/private/optimize.rkt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/collects/typed-scheme/private/optimize.rkt b/collects/typed-scheme/private/optimize.rkt index 6a786067..72c519a1 100644 --- a/collects/typed-scheme/private/optimize.rkt +++ b/collects/typed-scheme/private/optimize.rkt @@ -187,6 +187,11 @@ #:with opt (begin (log-optimization "int to float" #'op) #'(->fl n.opt))) + ;; we can get rid of it altogether if we're giving it an inexact number + (pattern (#%plain-app (~and op (~literal exact->inexact)) f:float-opt-expr) + #:with opt + (begin (log-optimization "float to float" #'op) + #'f.opt)) (pattern (#%plain-app op:pair-unary-op p:pair-opt-expr) #:with opt