From: Samantha Skyler
Subject: Underflow Help Needed
Date: 
Message-ID: <7271dfd0.0206140902.1129aaa@posting.google.com>
Hello,

Sorry for the repeat, but I still need help on this problem.

I'm doing genetic programming stuff, and the code that is generated
keeps getting under/overflow errors.

In lisp, what commands do I need to use in order to handle
under/overflow errors.

Idealy I would like to have an IF statement that says if there is an
error, return zero otherwise return the calculated value.

Thanks again
-Samantha
From: Barry Margolin
Subject: Re: Underflow Help Needed
Date: 
Message-ID: <HiqO8.14$FJ6.209@paloalto-snr2.gtei.net>
In article <···························@posting.google.com>,
Samantha Skyler <··············@hotmail.com> wrote:
>I'm doing genetic programming stuff, and the code that is generated
>keeps getting under/overflow errors.

That seems strange.  I wouldn't think that there would be much floating
point involved in genetic programming.  BTW, do you mean genetic
algorithms (evolutionary programming), or programs that deal with real
genetics (e.g. the human genome project)?  Not that any of this matters for
your question.

>In lisp, what commands do I need to use in order to handle
>under/overflow errors.
>
>Idealy I would like to have an IF statement that says if there is an
>error, return zero otherwise return the calculated value.

(defun /-without-underflow (a b)
  (handler-case (/ a b)
    (floating-point-underflow () (float 0.0 a))))

-- 
Barry Margolin, ······@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.