Re: Rounding off double precision



Probably not, different compilers print out a different number
of digits for list directed output. The standard doesn't
specify how many digits to print out for an * format. If
you want to experiment, try an explicit format.

double precision T
real R
T = COS(90 * 3.141592653589793238d0 / 180.)
R = T
write (*, '(E20.15)' ) T, R
write (*, '(F10.5)' ) T, R
end

Try different format widths (the 10 or 20) and number of digits
(the 5 or 15) until you get something you like.

Also, it's not obvious, but for output, double precision values
are printed with an E exponent when you use the E edit descriptor.
You could try using D20.15. Some processors print this with a D
exponent, others use an E.

*** Hendrickson

Yey! That explains why I have an E exponent instead of D, and why I
have fewer digits displayed. You are right, it's not a real error, but
that the compiler just didn't show the entire value when using the *
format.
.