> Date: Tue, 14 Nov 2000 11:10:36 -0500
> From: Robert Kernell <[log in to unmask]>
> Hi. I am teaching a Fortran class and I was wondering...
> Is there any use for specifying kinds for constants?
For floating-point constants--
If you are using only default precision, then there's none.
If you want non-default precision, such as double precision,
then constants may need to have "d0" suffixed (or some kind)
to ensure that they are stored as double precision.
All constants having more digits than default precision allows
must have "d0" or some kind specified. If this is not done,
the constant will be truncated, and will be stored as default precision
(typically 6 digits).
If you are using COMPLEX, you will need to specify the KIND
of variables for anything other than default precision, which may imply
the use of a KIND for constants.
> Bob Kernell
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|