Greetings,
I need to handle the exceptions generated by a call of the y = log10(x) when x equates 0 or is a negative number, I then count them and display the number of errors after my linear to logarithmic conversion. I wrote the following piece of code and it worked in another application, but it won't work now (the Log10ErrorCount is a global variable) :
int _matherr (struct _exception *Log10Error)
{
if (Log10Error->type == DOMAIN || Log10Error->type == SING)
{
Log10ErrorCount += 1;
return EXIT_FAILURE;
}
else
return EXIT_SUCCESS;
}
The only reason I think it isn't catching the exception is because I would have accidentally changed project options, which I didn't
Simon Lapierre
slapierre@sonomax.com
I need to handle the exceptions generated by a call of the y = log10(x) when x equates 0 or is a negative number, I then count them and display the number of errors after my linear to logarithmic conversion. I wrote the following piece of code and it worked in another application, but it won't work now (the Log10ErrorCount is a global variable) :
int _matherr (struct _exception *Log10Error)
{
if (Log10Error->type == DOMAIN || Log10Error->type == SING)
{
Log10ErrorCount += 1;
return EXIT_FAILURE;
}
else
return EXIT_SUCCESS;
}
The only reason I think it isn't catching the exception is because I would have accidentally changed project options, which I didn't
Simon Lapierre
slapierre@sonomax.com