Mail Archives: djgpp-workers/2003/08/29/17:24:34
Hello.
ams AT ludd DOT luth DOT se wrote:
>
> According to Kbwms AT aol DOT com:
> > > >>>The math functions shouldn't raise SIGFPE unless something goes
> > > >>>wrong.
> > > >By "something goes wrong", do you mean "an unreasonable argument was
> > > >passed", or do you mean "a bug in the math functions caused a problem"?
> > >
> > > I mean an unreasonable argument was passed (if passing arguments that
> > > causes overflow or underflow or ... is unreasonable).
> > >
> >
> > In this case, the affected math function sets errno to ERANGE and
> > (possibly) raises an appropriate exception. In no case should a math
> > function issue SIGFPE.
>
> What signal should it generate if not SIGFPE?
>
> For me raise an exception == generate a signal. Both Eli and you
> seems to say that raising an exception is something else than
> generating a signal.
>
> Can somebody explain this to me?
I think you're confusing the word "exception" in maths terms with "exceptions"
represented by SIG*. In the case of the maths "exceptions" I think the
exception is signalled by setting a bit in some exception register somewhere.
See section 7.6.1 (FE_* constants like FE_INVALID) and section 7.6.2 of the
C99 standard.
(That's from a quick read of the sections mentioned. I may be wrong.)
Bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
- Raw text -