home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!isi.edu!venera.isi.edu!tar
- From: tar@ISI.EDU (Thomas A. Russ)
- Newsgroups: comp.lang.lisp
- Subject: Re: Portable way to prevent underflow errors
- Message-ID: <21986@venera.isi.edu>
- Date: 21 Jul 92 21:23:45 GMT
- References: <1114@aplcomm.JHUAPL.EDU>
- Sender: news@isi.edu
- Reply-To: tar@isi.edu
- Organization: USC-ISI
- Lines: 24
- In-reply-to: paulmac@stdb.jhuapl.edu's message of 21 Jul 92 17:48:46 GMT
-
-
-
- You should take a look at the condition handling section in the 2nd
- edition of the CommonLisp reference.
-
- A simple solution to the immediate problem at hand (which I just tried
- under lucid 4.??) Transform
-
- (expt .9 500) ==> 1.32 e-23 but
- (expt .1 500) ==> Error. and
-
- into:
-
- (handler-case (expt .9 500)
- (floating-point-underflow nil 0)) ==> 1.32...e-23
-
-
- (handler-case (expt .1 500)
- (floating-point-underflow nil 0)) ==> 0
-
- --
-
- Thomas A. Russ tar@isi.edu
- USC/ISI, 4676 Admiralty Way, Marina del Rey, CA 90292 (310) 822-1511
-