Is infinity equal to infinity?

Erik Runeson <erikr@iar.se>
8 Jul 1998 01:36:08 -0400

          From comp.compilers

Related articles
Is infinity equal to infinity? erikr@iar.se (Erik Runeson) (1998-07-08)
Re: Is infinity equal to infinity? vosse@RULS41.FSW.LEIDENUNIV.NL (1998-07-10)
Re: Is infinity equal to infinity? rwhutch@nr.infi.net (1998-07-10)
Re: Is infinity equal to infinity? fis@mpi-sb.mpg.de (Matthias Fischmann) (1998-07-10)
Re: Is infinity equal to infinity? john_mitchell@intuit.com (John Mitchell) (1998-07-10)
Re: Is infinity equal to infinity? joachim.durchholz@munich.netsurf.de (Joachim Durchholz) (1998-07-10)
Re: Is infinity equal to infinity? bear@sonic.net (Ray Dillinger) (1998-07-11)
[12 later articles]
| List of all articles for this month |

From: Erik Runeson <erikr@iar.se>
Newsgroups: sci.math.num-analysis,comp.lang.c,sci.math,comp.compilers
Date: 8 Jul 1998 01:36:08 -0400
Organization: IAR Systems AB
Distribution: inet
Keywords: arithmetic, question

When comparing floating-point numbers, should infinity (Inf) be
concidered equal to infinity?


Inf == Inf ?


The IEEE 754 standard for floating-point arithmetics does not say
anything about this case, but a similar case is:


Inf - Inf = NaN


Any comparison with a NaN (Not a number) shall, according to the IEEE
754 be concidered unordered and return false. I believe that
comparing Inf with Inf should also be unordered, but this is not how it
is implemented in e.g GCC.


Any comments?


/Erik Runeson


----------------------------------------------------------------------
Erik Runeson
Email: erikr@iar.se (work, summer -98)
                d95err@csd.uu.se (home and education)
Cellphone: +46 708 723597
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.