Thanks xwb, im using a G77 compiler.
Actually the real*8 works.
But the maximum value for T is yet small. When i tried to reach "(T<2200000000)" for example, it doesn´t work.
Error msg:
~Fonte1.f:5:
do while (T<2200000000)
^
Integer at (^) too large
My...
My mistake, in the original program was:
"do while (T<17000099)"
How can i declare one double variable in Fortran?
I tried double :: var
But it doesn´t work.
Hey guys,
I have to program a Fortran code to solve the problem: S = 1/1 + 1/2 + ... + 1/T to get the largest S possible.
Actually my fortran program is like:
program test
implicit none
real :: T = 17000000, S = 0;
do while (T<17000000)
S = S + 1/T...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.