* Re: Floating point exceptions
1999-09-23 4:00 Floating point exceptions hinsen
@ 1999-09-23 4:00 ` Eberhard Burr
0 siblings, 0 replies; 4+ messages in thread
From: Eberhard Burr @ 1999-09-23 4:00 UTC (permalink / raw)
hinsen@cnrs-orleans.fr writes:
> But then I'd have to do all error handling myself. What I want is the
> documented error reporting behaviour of the math library, i.e. an error code
> in the global variable errno, because some routines in my code rely on it. In
> fact, the current behaviour of the machine violates the ANSI standard,
> according to my knowledge. I suppose someone must have noticed this before!
Sure. It was the first question I posted on cola too; it has come up
four times since and I only own my Alpha for two months now...
If you don't want to fiddle with the code, just add -mieee to your
compiler options and be happy; if you want to squeeze the best
performance out of your alpha, the math library from Compaq is for
you.
kind Regards,
--
Eberhard Burr check http://www.uni-karlsruhe.de/~Eberhard.Burr/publickey.asc
for PGP Key -- #include <stddisc.h> -- electric cookie follows
Death is nature's way of saying `Howdy'.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Floating point exceptions
@ 1999-09-23 4:00 hinsen
1999-09-23 4:00 ` Eberhard Burr
0 siblings, 1 reply; 4+ messages in thread
From: hinsen @ 1999-09-23 4:00 UTC (permalink / raw)
Joerg Schmalzl <joergs@earth.uni-muenster.de> writes:
> Konrad Hinsen wrote:
> >
> > 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:
But then I'd have to do all error handling myself. What I want is the
documented error reporting behaviour of the math library, i.e. an error code
in the global variable errno, because some routines in my code rely on it. In
fact, the current behaviour of the machine violates the ANSI standard,
according to my knowledge. I suppose someone must have noticed this before!
--
-----------------------------------------------------------------------------
-- Konrad Hinsen | E-Mail: hinsen@cnrs-orleans.fr Centre de Biophysique
Moleculaire (CNRS) | Tel.: +33-2.38.25.55.69 Rue Charles Sadron | Fax:
+33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France
| Nederlands/Francais
-----------------------------------------------------------------------------
--
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Floating point exceptions
@ 1999-09-23 4:00 Konrad Hinsen
1999-09-23 4:00 ` Joerg Schmalzl
0 siblings, 1 reply; 4+ messages in thread
From: Konrad Hinsen @ 1999-09-23 4:00 UTC (permalink / raw)
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?
--
-------------------------------------------------------------------------------
Konrad Hinsen | E-Mail: hinsen@cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.55.69
Rue Charles Sadron | Fax: +33-2.38.63.15.17
45071 Orleans Cedex 2 | Deutsch/Esperanto/English/
France | Nederlands/Francais
-------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Floating point exceptions
1999-09-23 4:00 Konrad Hinsen
@ 1999-09-23 4:00 ` Joerg Schmalzl
0 siblings, 0 replies; 4+ messages in thread
From: Joerg Schmalzl @ 1999-09-23 4:00 UTC (permalink / raw)
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
------------------------------------------------------------
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1999-09-23 4:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-09-23 4:00 Floating point exceptions hinsen
1999-09-23 4:00 ` Eberhard Burr
-- strict thread matches above, loose matches on Subject: below --
1999-09-23 4:00 Konrad Hinsen
1999-09-23 4:00 ` Joerg Schmalzl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox