delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2004/02/17/04:08:34

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
Date: Tue, 17 Feb 2004 11:07:21 +0200 (EET)
From: Esa A E Peuha <peuha AT cc DOT helsinki DOT fi>
Sender: peuha AT sirppi DOT helsinki DOT fi
To: djgpp-workers AT delorie DOT com
Subject: Re: C99 Functions Under Development and Checkout
In-Reply-To: <40312BCC.1080507@cyberoptics.com>
Message-ID: <Pine.OSF.4.58.0402171045160.22452@sirppi.helsinki.fi>
References: <c DOT 223440a1 DOT 2d5fdc07 AT aol DOT com> <40312BCC DOT 1080507 AT cyberoptics DOT com>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 16 Feb 2004, Eric Rudd wrote:

> Then came C99, which stipulated, for instance, that atan(+Inf,+Inf) =
> pi/4.  This is tantamount to saying that Inf/Inf = 1.  I made public
> objections to some of these things when C99 was out for review, but the
> C99 committee neither changed the draft standard nor gave a significant
> explanation of why it kept things as they were.  Thus, one could as well
> speak of "Blunders committed by IEEE 754 and C99".

I understand your point of view, but I also think that floating-point
numbers should not be thought of as real [pun intended] numbers; Inf,
for example, doesn't represent just the literal infinity, but also all
finite numbers that are far too large to fit into any floating-point
type, so it does make some sense to say that Inf/Inf is equal to 1.

> In practical terms, I suppose that none of this is very important, since
> generally one attempts to avoid these exceptional arguments, precisely
> because their effects are not consistent from system to system.

The point of C99 (well, one of them) is precisely to make them
consistent.  I think we should comply with the standard.

>  There
> is another reason for avoiding them: on the Pentium 4, the coprocessor
> handles NaNs, etc. through an exception mechanism that is as much as 300
> times slower than normal execution.

Well, keep the NaNs out of the coprocessor, then.  It's easy enough to
do, and apparently well worth it.

-- 
Esa Peuha
student of mathematics at the University of Helsinki
http://www.helsinki.fi/~peuha/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019