Re: Rounding off double precision
- From: Bamm <bammster@xxxxxxxxx>
- Date: Sat, 29 Mar 2008 08:36:52 -0700 (PDT)
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.
.
- References:
- Rounding off double precision
- From: Bamm
- Re: Rounding off double precision
- From: Bamm
- Re: Rounding off double precision
- From: Richard Maine
- Re: Rounding off double precision
- From: Bamm
- Re: Rounding off double precision
- From: *** Hendrickson
- Rounding off double precision
- Prev by Date: Re: Rounding off double precision
- Next by Date: Re: How to Read csv Files with both Characters and Numbers?
- Previous by thread: Re: Rounding off double precision
- Next by thread: Re: Rounding off double precision
- Index(es):