Hi,
It is common to have code like the following, where accumulation
is into a DP variable:
REAL :: x( 100 )
DOUBLE PRECISION :: sumx
INTEGER i
...
sum = 0
DO i = 1, 100
sumx = sumx + x( i )
END DO
One is tempted to preplace the DO loop with the F90 statement:
sumx = sum( x )
However, AFAIK, the summation will then be done in single precision.
Is this correct? If so, I guess I still have to use the
DO loop. :-)
Thanks,
-P.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|