gfortran help
-
- Posts: 71
- Joined: 2015/10/06 11:17:19
gfortran help
hi centos expert
How can I access a help for gfortran in terminal?
thanks
samad
How can I access a help for gfortran in terminal?
thanks
samad
-
- Posts: 71
- Joined: 2015/10/06 11:17:19
Re: gfortran help
If we want to know about the sine function. there is no thing about that in "man gfortran"
thanks
thanks
Re: gfortran help
Is this any help:
https://pages.mtu.edu/~shene/COURSES/cs ... funct.html
https://pages.mtu.edu/~shene/COURSES/cs ... funct.html
Re: gfortran help
The language reference is in:
The "sine" is in "Intrinsic procedures".
Code: Select all
info gfortran
-
- Posts: 71
- Joined: 2015/10/06 11:17:19
Re: gfortran help
for example i want to calculate sin(10):
result:
it is different from real resut from calculator:
-0.54402111088937
Code: Select all
program test
real a
a = sin(10.0)
print*, a
end program
Code: Select all
[samad@localhost test]$ gfortran test1.f95 -o test1 && ./test1
-0.544021130
-0.54402111088937
Re: gfortran help
What is the default precision? See https://www.tutorialspoint.com/fortran/ ... cision.htm
Re: gfortran help
Also, why assume that the calculator has the "real" result?
Re: gfortran help
According to Mathematica, the first 80 digits are
Code: Select all
sin(10) = -0.544021110889369813404747661851377281683643012916223891574184012...
Re: gfortran help
A long time since I used fortran, but I seem to remember
that "real" by default uses 4 bytes. You could try real*8
instead for higher precision.
Edit: Just tested real*8 which gives this:
-0.54402112960815430
that "real" by default uses 4 bytes. You could try real*8
instead for higher precision.
Edit: Just tested real*8 which gives this:
-0.54402112960815430