From malcolm@brackley.nag.co.uk  Thu Mar 30 13:32:51 2000
Received: from brackley.nag.co.uk ([62.232.54.10])
	by dkuug.dk (8.9.2/8.9.2) with ESMTP id NAA25753
	for <SC22WG5@dkuug.dk>; Thu, 30 Mar 2000 13:32:50 +0200 (CEST)
	(envelope-from malcolm@brackley.nag.co.uk)
Received: (from malcolm@localhost)
	by brackley.nag.co.uk (8.9.2/8.9.2) id MAA83530
	for SC22WG5@dkuug.dk; Thu, 30 Mar 2000 12:31:50 +0100 (BST)
	(envelope-from malcolm)
From: Malcolm Cohen <malcolm@nag.co.uk>
Message-Id: <200003301131.MAA83530@brackley.nag.co.uk>
Subject: Re: (SC22WG5.1748) Interpretation 004
To: SC22WG5@dkuug.dk
Date: Thu, 30 Mar 2000 12:31:50 +0100 (BST)
X-Mailer: ELM [version 2.4ME+ PL43 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Henry Zongaro wrote:
>     For instance, 4.3.1.2 of the Fortran 95 standard states that "The real
>type has values that approximate the mathematical real numbers".  IEEE
>infinity doesn't seem to fit that description.

They certainly would be rather poor approximations, since the mathematical
real numbers have no infinities.

They do not even have the semantics of being of larger magnitude than the
largest (finite) floating-point number - they just mean that they are the
result of an overflow at some point.  E.g.
   X = AINT(X*100)/100   ! Round X to 2 decimal places
will be "Infinity" for ABS(X)>HUGE(X)/100 on IEEE machines.

These infinities really are "exceptional" values - which mean something like
"I don't know what the answer is, but it used to be big in the past...".

I realise that since all floating-point values are approximations, the weird
properties of the infinities can be weaselled out of; I just consider that an
approximation in which not just all the mantissa is wrong but all the exponent
is wrong (and even the sign is likely to be wrong) is not a good enough
approximation.  Others mileages doubtlessly vary.

John Reid <J.Reid@letterbox.rl.ac.uk> on 03/28/2000 05:34:06 AM wrote:
>>ANSWER:
>>Processors may support values that are not present in the model of
>>13.7.1. IEEE -inf is an example of such a number and this should be
>>returned on a machine that supports the IEEE standard.  If the negative

I disagree with the "should be".  I would not object to "may be"
(though I still think it is the wrong thing to do).

>>It may be helpful to consider how MAXVAL might be coded for an array
>>of rank one on an IEEE computer. The following code is suitable
>>
>>     MAXVAL = IEEE_VALUE(1.0,IEEE_NEGATIVE_INF)
>>     DO I = 1, SIZE(ARRAY)
>>        MAXVAL = MAX(MAXVAL,ARRAY(I))
>>     END DO

ref the IEEE modules; by turning on overflow trapping (IEEE_SET_HALTING_MODE)
- which is the default on some systems - the production of infinities other
than by the artificial IEEE_VALUE method causes program termination.  This
reinforces my viewpoint that these are more like exception values than like
approximations.

Cheers,
-- 
...........................Malcolm Cohen, NAG Ltd., Oxford, U.K.
                           (malcolm@nag.co.uk)
