Victor Bazarov wrote:
>
> "Frank Schmitt" <> wrote...
> > "Victor Bazarov" <> writes:
> >
> > > "klaas" <> wrote...
> > > > How does a NaN occur?
> > >
> > > 0 * infinity, 0/0, infinity + / - infinity.
> >
> > This makes me wonder - shouldn't infinity + infinity just
> > return infinity?
>
> You're right. Different sources tell different stories.
> I wasn't using any IEEE-certified document, just some web
> site. Another site claims the same except inf + inf. That
> does allegedly result in infinity.
>
Infinities are usually signed. My recollection is that under IEEE-754,
positive infinity + positive infinity is positive infinity; negative
infinity + negative infinity is negative infinity. When the signs of the
infinities are different the result is NaN.
--
Pete Becker
Dinkumware, Ltd. (
http://www.dinkumware.com)