From: Joerg Schmalzl <joergs@earth.uni-muenster.de>
Subject: Re: Floating point exceptions
Date: 1999/09/23 [thread overview]
Message-ID: <37EA1915.3F54@earth.uni-muenster.de> (raw)
In-Reply-To: m3puzat1c0.fsf@chinon.cnrs-orleans.fr
Konrad Hinsen wrote:
>
> I am trying to install some numerical code on an Alpha system running
> RedHat 6.0, and I get lots of crashes. It seems that the math library
> generates a floating point exception in many cases (e.g. log(-1.))
> where I'd rather like to get an error code back to my routines.
> Is there any way to change this?
> --
Sure ... install a signal handler:
in the main prog call
(void) signal(SIGFPE, error_handler);
where you can define the error handler yourself e.g.
error_handler(err_sig)
int err_sig;
{
/** do something here **/
}
You have to include signal.h of course ..
Cheers,
Joerg
--
------------------------------------------------------------
Dr. Joerg Schmalzl, Institute of Geophysics, Muenster
University , Corrensstr. 24, D-48149 Muenster, Germany,
phone, office: (++49) 251 8334703, priv.: (++49) 251 784820,
fax: (++49) 251 8336100, e-mail: joergs@earth.uni-muenster.de
------------------------------------------------------------
next prev parent reply other threads:[~1999-09-23 4:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-09-23 4:00 Floating point exceptions Konrad Hinsen
1999-09-23 4:00 ` Joerg Schmalzl [this message]
-- strict thread matches above, loose matches on Subject: below --
1999-09-23 4:00 hinsen
1999-09-23 4:00 ` Eberhard Burr
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox