|
|
It's a useful (but not necessary) math error handling function, and it's
not ANSI standard (I saw something saying it's a System V feature), so
maybe it's not surprising that it doesn't work under OpenBSD. If it is
available, then the exception structure is defined, and if it's not
defined, it causes problems (like those you saw), and the matherr
facility shouldn't be used. The solution would seem to be to check
whether exception is defined. Try the following:
#ifdef UNDERFLOW
#ifdef exception
/* note: the above line is added */
int matherr(x)
struct exception *x;
{
switch (x->type)
{
case DOMAIN:
case OVERFLOW:
x->retval = 1.0e17;
break;
case SING:
case UNDERFLOW:
x->retval = 0.0;
break;
}
return (1);
}
#endif
/* note: the above line is added */
#endif
I suspect that it will work after those changes are made (barring other
problems, that is). Let me know how it goes.
-Mark Gordon
Post a reply to this message
|
|