From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!newsfeed.esat.net!nslave.kpnqwest.net!nloc.kpnqwest.net!nmaster.kpnqwest.net!nreader2.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: very large reals? References: <87y9hodkux.fsf@photino.sid.rice.edu> Mail-Copies-To: never From: Erik Naggum Message-ID: <3223233009092284@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 23 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 20 Feb 2002 22:30:06 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader2.kpnqwest.net 1014244206 193.71.199.50 (Wed, 20 Feb 2002 23:30:06 MET) NNTP-Posting-Date: Wed, 20 Feb 2002 23:30:06 MET Xref: archiver1.google.com comp.lang.lisp:26980 * Rahul Jain | If you really don't care about precision, you could try operating on the | logs of the values in question, and multiplying instead of | exponentiating, etc. I suppose doing (expt (round number) base) would be | the way of converting them back to bignums. If you choose base 10, computing with the logarithms is pretty easy for most mathematical operations. Printing the value is not very hard, either: Just print the antilogarithm of the fractional part followed by the usual E and the integral part with a sign, and voila! you have the regular floating-point format. Reading such numbers back in into logarithmic form is also a piece of cake: read the string, split it on the exponent marker, read the floating point number from the string, take the logarithm, which should now be in the range [0,1), and just add the integer exponent you read from the rest of the string. This way, you can work with floating-point representations of logarithms. It might take some getting used to, but before computers, people used to work with logarithmic projections all the time. Remember the slide rule? :) /// -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief.