home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / lisp / 2063 < prev    next >
Encoding:
Internet Message Format  |  1992-07-21  |  1.2 KB

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