home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!aplcomm!stdb.jhuapl.edu!paulmac
- From: paulmac@stdb.jhuapl.edu (Paul McNamee)
- Newsgroups: comp.lang.lisp
- Subject: Portable way to prevent underflow errors
- Message-ID: <1114@aplcomm.JHUAPL.EDU>
- Date: 21 Jul 92 17:48:46 GMT
- Sender: news@aplcomm.JHUAPL.EDU
- Reply-To: @mailer.jhuapl.edu:paulmac@stdb.jhuapl.edu (Paul McNamee)
- Organization: The Johns Hopkins University Applied Physics Laboratory
- Lines: 20
-
-
- I'm looking for a way to prevent errors caused by exponentiation where I'm
- raising a number between [0-1] to an integer [0-infinity) power. This
- would be simple if my underflow were due to division by zero but with
- exponentiation
- (expt .9 500) ==> 1.32 e-23 but
- (expt .1 500) ==> Error. and
- Thus it seems hard to predict and prevent the later case (by not calling it).
- In my case the obvious solution of returning zero is quite acceptable.
- Symbolics supports this with a without-floating-underflow-traps macro.
- Does Lucid provide a utility for this?
-
- Perhaps there is a mathematical way to do this using long-float-epsilon and
- least-positive-double-float, but my horribly deficient mathematical mind
- hasn't thought up one.
-
- Thanks for any assistance,
-
- Paul McNamee
- paulmac@stdb.jhuapl.edu
-