This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: infinity != infinity

> The standard is apparently less than explicit on this particular point.  
> But e.g.
> says the intent was that infinity was supposed to compare equal with
> itself:
> > To remove doubt as to the intent: In an implementation guide to a draft
> > version of the standard, Coonen [_Computer_, 13: 1, p. 78] gives a table
> > which clearly shows that +oo = +oo and -oo = -oo are to be TRUE.

But the question remains, was this derived from his note of the standards
commitee meetings, or from his personal interpretation of the standard
(or maybe even his preconception of what it should be) ?

> and
> > The standard states that
> >         Infinity arithmetic shall be construed as the limiting case of real
> >         arithmetic with operands of arbitrarily large magnitude, when such a
> >         limit exists. Infinities shall be interpreted in the affine sense, that is,
> >         -oo < (every finite number) < +oo.
> > This *seems* to make it clear that the infinities of the standard represent
> > the two improper elements of the extended real number system. And
> > although many mathematicians may warn that +oo is not actually a
> > number, they should still agree that +oo = +oo is TRUE in the extended
> > real number system.

I can't follow that reading.  The results you get by applying the limit operator
are different from using extended reals.

> The current draft of the upcoming revision to 754 makes the latter point
> more explicit:
> "The mathematical standard underpinning the arithmetic in this standard
> is the extended reals [...]."

I missed the significance of this bit.  There is a contradiction in the
standard then.

> Now there are apparently other opinions as well as to how to interpret
> the standard on this point, and I'm not sure who has the definite answer.
> But why should we now deviate from existing behaviour in hardware
> implementations (and GCC implementation up to now)?

I am implementing some software floating point functions, and found that
I got testuite regressions that I traced down to the interpretation of
the standard.  I didn't want to add a bug to my implementtion just to
match a pervious bug in some preceding implementations.

But it appears that there is an issue with the standard itself.  Mind you,
it'd certainly is a whole less hassle if the standard actually mandated
+oo == +oo && -oo == -oo, even though it is inconsistent.

It seems like it would be a good idea to ask the current working group for
a clarification; however, when I tried to to follow the instructions at ,
I got only errors from majordomo (unknown list 'stds-754', 
Command 'lists' not recognized.)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]