Re: Rounding off double precision




"Bamm" <bammster@xxxxxxxxx> wrote in message
news:eab4fbe9-3cf4-4015-9a87-e5e9a872f808@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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.

you would use something like :
double precision, parameter :: PI = 3.14159.......d0

integer, parameter :: ITYPE = 1

and so on

Les


.



Relevant Pages

  • Re: Rounding off double precision
    ... Not in Fortran, unless "Pi" has been typed DOUBLE PRECISION or has the ... The text you quoted above reads "creates a literal constant ... that it is being assigned to a single-precision parameter is something ...
    (comp.lang.fortran)
  • Re: Rounding off double precision
    ... Not in Fortran, unless "Pi" has been typed DOUBLE PRECISION or has the ... that it is being assigned to a single-precision parameter is something ... A parameter is not a literal constant and vice-versa. ...
    (comp.lang.fortran)
  • Re: modifying constants
    ... Fortran has literal constant forms for all ... literal constant forms for all intrinsic types. ... bit string, I'm confident. ... "make way" for decimal floats. ...
    (comp.lang.fortran)
  • Re: Rounding off double precision
    ... "3.141592653589793238d0" and is a double precision value. ... that it is being assigned to a single-precision parameter is something ... A parameter is not a literal constant and vice-versa. ... So how do you declare a constant in Fortran? ...
    (comp.lang.fortran)
  • Re: IF DEAD, GOTO 10-3-39
    ... -> -What does FORTRAN offer you that you don't find in anything else nowadays? ... -> Are there still any implementations that pass literal parameters by reference? ... Are we using the mathematical definition of "literal constant" or are ... If we're using the mathematical definition of literal constant, ...
    (rec.sport.football.college)