At 12:05 AM 6/23/98 PDT, Robin Vowels wrote:
>> Peter Shenkin wrote:
>> >
[snip]
>> >
>>
>> In my sense (and as was stated by Michel Olagnon), to make DPROD a
>> really useful function, the standard should simply say that the result
>> should be equivalent to DBLE()*DBLE().
>
>No, it dosn't need this to make it a "useful" function.
>It is sufficient to have stated that a double precision result is
>obtained. That allows the implementor to produce code for the
>most efficient way to do it.
>
The problem is that DPROD is already "defined" and J3 is very unlikely
to redefine it. I agree that it is not useful as defined. But, there
is great reluctance to make nonconforming improvements to the
standard, particularily when it is possible to state what you more or
less mean with existing syntax.
What F95 says for DPROD is
"result characteristics: Double precision real
result value: The result has a processor-dependent approximation to the
product of X and Y."
That's it. Nowhere does it say when or how things get converted to
double. This means that both dble(x)*dble(y) and dble(x*y) are
acceptable. On machines I'm familiar with, they will usually give
different answers for fractional values of x and y.
This is too bad, but it's not likely to be changed.
Dick Hendrickson
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|