[Ieee-floats-devel] underflows, overflows

Alexey Goldin alexey.goldin at gmail.com
Thu Dec 14 14:02:00 UTC 2006


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!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ieee-floats-devel/attachments/20061214/74a32c12/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: binary-io-utils.tar.gz
Type: application/x-gzip
Size: 2065 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/ieee-floats-devel/attachments/20061214/74a32c12/attachment.bin>


More information about the Ieee-floats-devel mailing list