<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>
GitLab
</title>

</head>
<body>
<style type="text/css">
img {
max-width: 100%; height: auto;
}
</style>
<div class="content">
<h3>
Raymond Toy pushed to branch master
at <a href="https://gitlab.common-lisp.net/cmucl/cmucl">cmucl / cmucl</a>
</h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/bb4afde9814ae938cc7f8de539328a1619f6fa30">bb4afde9</a></strong>
<div>
<span>by Raymond Toy</span>
<i>at 2016-05-13T17:37:58-07:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap">Fix #22 where coerce was returning the wrong type of float.

src/compiler/float.lisp:
o The deftransform coerce was checking for a type of 'float and using
  %single-float to do the conversion.  This is incorrect; it should
  only apply if the type is 'single-float.

tests/issues.lisp
o Add test for this.

Verified that the test fails on the current snapshot and ix fixed by
this change.</pre>
</li>
</ul>
<h4>2 changed files:</h4>
<ul>
<li class="file-stats">
<a href="#620f2ecad2bb6f74b2fcd0134963a841" style="text-decoration: none">
src/compiler/float-tran.lisp
</a>
</li>
<li class="file-stats">
<a href="#ad29afc395839758d41094872298bd0d" style="text-decoration: none">
tests/issues.lisp
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id="620f2ecad2bb6f74b2fcd0134963a841">
<a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/bb4afde9814ae938cc7f8de539328a1619f6fa30#diff-0">
<strong>
src/compiler/float-tran.lisp
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="background: #ffdddd; color: #000000">--- a/src/compiler/float-tran.lisp
</span><span style="background: #ddffdd; color: #000000">+++ b/src/compiler/float-tran.lisp
</span><span style="color: #aaaaaa">@@ -76,7 +76,7 @@
</span>             '(%double-double-float n))
                 ((csubtypep tspec (specifier-type 'double-float))      
                  '(%double-float n))   
<span style="background: #ffdddd; color: #000000">-              ((csubtypep tspec (specifier-type 'float))
</span><span style="background: #ddffdd; color: #000000">+                 ((csubtypep tspec (specifier-type 'single-float))
</span>             '(%single-float n))
                 #+double-double
                 ((csubtypep tspec (specifier-type '(complex double-double-float)))
</code></pre>

<br>
</li>
<li id="ad29afc395839758d41094872298bd0d">
<a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/bb4afde9814ae938cc7f8de539328a1619f6fa30#diff-1">
<strong>
tests/issues.lisp
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="background: #ffdddd; color: #000000">--- a/tests/issues.lisp
</span><span style="background: #ddffdd; color: #000000">+++ b/tests/issues.lisp
</span><span style="color: #aaaaaa">@@ -200,3 +200,13 @@
</span>         tests))
           `(progn ,@(nreverse tests)))))
     (make-tests)))
<span style="background: #ddffdd; color: #000000">+
+(define-test issue.22
+    (:tag :issues)
+  (let ((tester (compile nil '(lambda (x)
+                              (coerce x 'float)))))
+    (assert-eql 1.0 (funcall tester 1))
+    (assert-eql 2f0 (funcall tester 2f0))
+    (assert-eql 3d0 (funcall tester 3d0))
+    (assert-eql 4w0 (funcall tester 4w0))))
+    
</span></code></pre>

<br>
</li>

</div>
<div class="footer" style="margin-top: 10px">
<p style="color: #777; font-size: small">

<br>
<a href="https://gitlab.common-lisp.net/cmucl/cmucl/commit/bb4afde9814ae938cc7f8de539328a1619f6fa30">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.common-lisp.net.
If you'd like to receive fewer emails, you can
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://gitlab.common-lisp.net/cmucl/cmucl/commit/bb4afde9814ae938cc7f8de539328a1619f6fa30"}}</script>
</p>
</div>
</body>
</html>