This is the mail archive of the gcc@gcc.gnu.org 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


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 


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