Mail Archives: djgpp-workers/2004/02/17/04:08:34
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 -