Re: Rounding off double precision
- From: *** Hendrickson <***.hendrickson@xxxxxxx>
- Date: Mon, 31 Mar 2008 16:11:00 GMT
Bamm wrote:
Sigh. The text you quoted above reads "creates a literal constant
with the double-precision value". The literal constant is
"3.141592653589793238d0" and is a double precision value. The fact
that it is being assigned to a single-precision parameter is something
different. A parameter is not a literal constant and vice-versa.
So how do you declare a constant in Fortran? I thought parameter was
the way constants were defined in Fortran, but if there is a better
way, I'd like to try it.
We're being exact with language here. In the statement
parameter (pi = 3.14)
3.14 is a literal constant and pi becomes a named constant. The
parameter statement gives names to literal constants.
It's an important distinction when the name and the constant have
different types or kinds. The "=" in the parameter statement
follows the same rules for type conversion as does ordinary
assignment and converts the right hand side to the type/kind
of the left (except for a special case for some character
parameters).
*** Hendrickson
.
- 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: e p chandler
- Re: Rounding off double precision
- From: Bamm
- Re: Rounding off double precision
- From: glen herrmannsfeldt
- Re: Rounding off double precision
- From: Charles Coldwell
- Re: Rounding off double precision
- From: glen herrmannsfeldt
- Re: Rounding off double precision
- From: Chip Coldwell
- Re: Rounding off double precision
- From: Dave Seaman
- Re: Rounding off double precision
- From: Chip Coldwell
- Re: Rounding off double precision
- From: Bamm
- Rounding off double precision
- Prev by Date: Re: Rounding off double precision
- Next by Date: Re: Press any key to continue?
- Previous by thread: Re: Rounding off double precision
- Next by thread: Re: Rounding off double precision
- Index(es):