I was quite excited to see your project --- recently I needed something like this and even wrote similar utils. Unfortunately I believe your code suffers from incorrectly interpreting underflows and overflows.<br><br>For example:
<br><br>(format t "~b" (parse-integer "47" :radix 16))<br>1000111<br>NIL<br>CL-USER> <br>IEEE-FLOATS> (encode-float32 9.9492191e-44)<br>; Evaluation aborted<br>IEEE-FLOATS> (decode-float32 #b1000111)
<br>5.0446745e-44<br>IEEE-FLOATS> <br><br>According to <a href="http://babbage.cs.qc.edu/IEEE-754/">http://babbage.cs.qc.edu/IEEE-754/</a><br><br>this binary pattern is more like <br>9.9492191e-44<br><br><br>Attached is my code with tests. It is uglier then yours and does not handle nan, infinity, etc.
<br><br>May be you can incorporate changes, I then should be able to wipe mine code and just use yours. If not, I'll be able to send you patches in few days.<br><br>Thanks!<br>