J3/00-160
Date: 17 April 2000
To: J3
From: John Reid
Subject: Interpretation 004
Here are drafts for the ANSWER and EDITS sections of 004. Also, I
propose that the addendum be removed.
Malcolm disagrees with me on this one and we have had to 'agree to
disagree'. He objects to "should be", but would not object to "may be"
(but still thinks it is the wrong thing to do).
I have asked a few of my mathematical friends what they think and
those that are familiar with the IEEE standard and the thinking
behind it agree with me that asking for MAXVAL for a zero-size
array is just like asking for -1.0/0.0 and should return -inf.
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
number of largest magnitude in the model had been intended, the model
would have been mentioned as, for example, in the definition of HUGE
(13.14.39).
A simple example of its use is to test whether a set of numbers SET1
has a value greater than any value in the set SET2. Consider the
expression MAXVAL(SET1)>MAXVAL(SET2). If SET1 is empty and SET2 is not,
this value is (correctly) false even if all the values are outside the
model with values less than -HUGE(SET1).
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
EDITS: None.