[Ieee-floats-devel] underflows, overflows
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. For example: (format t "~b" (parse-integer "47" :radix 16)) 1000111 NIL CL-USER> IEEE-FLOATS> (encode-float32 9.9492191e-44) ; Evaluation aborted IEEE-FLOATS> (decode-float32 #b1000111) 5.0446745e-44 IEEE-FLOATS> According to http://babbage.cs.qc.edu/IEEE-754/ this binary pattern is more like 9.9492191e-44 Attached is my code with tests. It is uglier then yours and does not handle nan, infinity, etc. 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. Thanks!
participants (1)
-
Alexey Goldin