This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: infinity != infinity
- From: Waldek Hebisch <hebisch at math dot uni dot wroc dot pl>
- To: gcc at gcc dot gnu dot org
- Date: Sat, 10 Jul 2004 15:17:30 +0200 (CEST)
- Subject: Re: infinity != infinity
Joern Rennecke wrote:
> However, as I interpret ieee 754, +inf compares unorderd to +inf,
> and likewise -inf compares unordered to -inf.
>
> 6.1 Says that that infinity arithmetic shall be construed as the limiting
> case of real aritmetic of arbitrary large magnitude, where such a limit
> exists.
I do not think that in 6.1 comparisons are treated as arithmetic operations.
Normal arithmetic is countinuous and taking limit makes sense.
Comparisons are discontinuous so limits do not exist (as you noted).
In fact in math it is normal to define comparisons first, and then use
comparisons to define limits.
I do not know what IEEE 754 says elsewere. From programmer point of
view both having +inf eqaul +inf and unorderd versions make sense.
In math it is normal to take linear order on extended real line (hence
you get "x equals x" as long as x is finite or infinity). I heard
that IEEE 754 tried to follow math here.
--
Waldek Hebisch
hebisch@math.uni.wroc.pl