[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Specifying signs when f(0)=0



On 2007-05-27 14:41:14 +0100, Nick Maclaren wrote:
Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
One that I heard, but haven't checked out thoroughly, is that it is
needed for interval arithmetic.  The claim was that the interval
[-0,x] includes true zero, whereas [+0,x] doesn't.  I was and am
unconvinced, but would need to study the matter further to be sure.

This would mean that pow(-0, 2) should return -0 when rounding toward
negative.

Yes.

FYI, C99 says in F.9 that pow(-0, 2) returns +0.

However, if the tests are a problem, enabling traps allows to
avoid them.

They are more-or-less deprecated by IEEE 754, IEEE 754R and C99.

Where did you see that?

In those documents.

Where in those documents?

Many implementors read them as forbidding traps, even as an option,
and I have had heated and unsuccessful arguments pointing out that
is not so.

Which implementors?

C99, of course, DOES forbid them even as an option in IEEE 754 mode.

AFAIK they are not forbidden. F.7 says about <fenv.h>: "It includes also 
IEC 60559 dynamic rounding precision and trap enablement modes, if the 
                                         ^^^^^^^^^^^^^^^^^^^^^
implementation supports them."

H.3.1 says: "C allows an implementation to provide notification.
C’s SIGFPE (for traps) and FE_INVALID, FE_DIVBYZERO, FE_OVERFLOW,
FE_UNDERFLOW (for indicators) can provide LIA−1 notification."

So, how can you say that C99 forbids traps for FP exceptions?

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)

754 | revision | FAQ | references | list archive