From: Samantha Skyler
Subject: Cheating Underflow/Overflow Help Needed
Date: 
Message-ID: <3fd88790.0205251954.75a96975@posting.google.com>
Hello all

I'm writing a subfunction that uses a lot of expt functions, so it
tends to crash my main program a lot with over/underflow errors.

I wanted to know if there is anyway to intercept this error and,
instead of crashing, have my subprogram return some value (-1, NIL,
whatever) whenever an error occurs so my main program can keep going.

Thanks a lot

-Samantha

From: Frank A. Adrian
Subject: Re: Cheating Underflow/Overflow Help Needed
Date: 
Message-ID: <vlZH8.342$wj4.254555@news.uswest.net>
Samantha Skyler wrote:
> I wanted to know if there is anyway to intercept this error and,
> instead of crashing, have my subprogram return some value (-1, NIL,
> whatever) whenever an error occurs so my main program can keep going.

There are several.  Look at section 9 of the Hyperspec 
(http://www-2.cs.cmu.edu/Groups/AI/html/hyperspec/HyperSpec/Body/chap-9.html).

In addition, you might want to look at using numeric type other than 
floating point.  Rationals or rolling your own scaled integral type will 
give you what you need without any possibility of overflow.

faa
From: Erik Naggum
Subject: Re: Cheating Underflow/Overflow Help Needed
Date: 
Message-ID: <3231409155397588@naggum.net>
* Samantha Skyler
| I'm writing a subfunction that uses a lot of expt functions, so it
| tends to crash my main program a lot with over/underflow errors.

  This is so common a request that IEEE 754 has support for not causing an
  overflow or underflow, but instead return 0 and the largest possible
  value (as opposed to an internal "infinity" value).  This is not directly
  supported by the Common Lisp standard, but you should find some support
  for it in your implementation, or, if not, you should request it.
-- 
  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.

  70 percent of American adults do not understand the scientific process.