xemacs floats
Mats Cronqvist <[email protected]> Mon, 21 Mar 2005 16:17:51 +0100
| Newsgroups | gmane.comp.lang.erlang.distel.devel |
|---|---|
| Message-ID | <[email protected]> |
dear distel-hackers (if there still are any),
i finally managed to get through the firewall of a multinational telecom
corporation and downloaded jungerl. alas, to my dismay distel didn't work.
turns out it's because i use xemacs, and this code (from derl.el) seems to be
FSFmacs specific;
(if (string= "1.0e+INF" (format "%S" (condition-case ()
(/ 1.0 0)
(error nil))))
i think the purpose of this test is to see if IEEE floats are used. however,
i think what it's really testing is if it's an FSFmacs with IEEE support.
i just commented out the test, and it works fine.
caveat; i know nothing of lisp, or distel for that matter. read on at your peril.
couldn't one test for the proper functionality instead, possibly something like;
(defun derl-int32-to-decimal (s)
"Converts a 32-bit number (represented as a 4-byte string) into its
decimal printed representation."
(format "%.0f" (+ (+ (aref s 3) (* 256 (aref s 2)))
(* (+ 0.0 (aref s 1) (* 256 (aref s 0)))
65536))))
(if (string= "1819634533" (derl-int32-to-decimal "luke"))
()
(error "un-defun derl-int32-to-decimal"))
mats
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click