From: Kbwms AT aol DOT com Message-ID: <114.2823ab81.2c822fce@aol.com> Date: Sat, 30 Aug 2003 12:50:22 EDT Subject: Re: Arithmetic Exceptions in C99 To: djgpp-workers AT delorie DOT com MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="part1_114.2823ab81.2c822fce_boundary" X-Mailer: 8.0 for Windows sub 6015 Reply-To: djgpp-workers AT delorie DOT com --part1_114.2823ab81.2c822fce_boundary Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit In a message dated 8/30/2003 5:28:52 AM Eastern Standard Time, eliz AT elta DOT co DOT il writes: > >Date: Fri, 29 Aug 2003 17:01:17 -0500 > >From: Eric Rudd > > > >I am still of the opinion that it is > >best to prevent the math functions from either raising signals or > >setting exception bits in the FPU status register, because they can > >crash a program and prevent recovery. > > We could implement the exceptions bitmap as a special word that is > physically different from the x87 status register. The functions that > return the exceptions info could then look at that word and also at > the x87 status word. > Has anyone bothered to look at the source for libm.a to see what they do? I see expressions like (x-x)/(x-x) to produce a NaN and turn on the floating point invalid exception and "huge + x" (where huge = 1.0e30) to turn on the floating point inexact exception. In the log function is "-two54/zero" to turn on the floating point divide-by-zero exception and generate -infinity. Has anyone ever had any problems with these functions? --part1_114.2823ab81.2c822fce_boundary Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable In a message dated 8/30/2003 5:28:52 AM Eastern Standard= Time, eliz AT elta DOT co DOT il writes:

>Date: Fri, 29 Aug 2003 17:01:17 -0500
>From: Eric Rudd <rudd AT cyberoptics DOT com>
>
>I am still of the opinion that it is
>best to prevent the math functions from either raising signals or
>setting exception bits in the FPU status register, because they can
>crash a program and prevent recovery.

We could implement the exceptions bitmap as a special word that is
physically different from the x87 status register.  The functions that<= BR> return the exceptions info could then look at that word and also at
the x87 status word.


Has anyone bothered to look at the source for libm.a to see what they do?&nb= sp; I see expressions like (x-x)/(x-x) to produce a NaN and turn on the floa= ting point invalid exception and "huge + x" (where huge =3D 1.0e30) to turn=20= on the floating point inexact exception.  In the log function is "-two5= 4/zero" to turn on the floating point divide-by-zero exception and generate=20= -infinity.

Has anyone ever had any problems with these functions?
--part1_114.2823ab81.2c822fce_boundary--