gfortran help

Issues related to applications and software problems and general support
abdossamad2003
Posts: 71
Joined: 2015/10/06 11:17:19

gfortran help

Post by abdossamad2003 » 2021/05/10 11:10:22

hi centos expert
How can I access a help for gfortran in terminal?
thanks
samad

BShT
Posts: 583
Joined: 2019/10/09 12:31:40

Re: gfortran help

Post by BShT » 2021/05/10 11:16:38

man gfortran ?

abdossamad2003
Posts: 71
Joined: 2015/10/06 11:17:19

Re: gfortran help

Post by abdossamad2003 » 2021/05/10 11:47:39

If we want to know about the sine function. there is no thing about that in "man gfortran"

thanks

tunk
Posts: 1204
Joined: 2017/02/22 15:08:17

Re: gfortran help

Post by tunk » 2021/05/10 12:27:51


User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: gfortran help

Post by jlehtone » 2021/05/10 12:28:56

The language reference is in:

Code: Select all

info gfortran
The "sine" is in "Intrinsic procedures".

abdossamad2003
Posts: 71
Joined: 2015/10/06 11:17:19

Re: gfortran help

Post by abdossamad2003 » 2021/05/10 12:58:48

for example i want to calculate sin(10):

Code: Select all

program test
real a
a = sin(10.0)
print*, a
end program
result:

Code: Select all

[samad@localhost test]$ gfortran test1.f95 -o test1 && ./test1 
 -0.544021130    
it is different from real resut from calculator:
-0.54402111088937

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: gfortran help

Post by jlehtone » 2021/05/10 13:39:37


MartinR
Posts: 714
Joined: 2015/05/11 07:53:27
Location: UK

Re: gfortran help

Post by MartinR » 2021/05/10 13:45:46

Also, why assume that the calculator has the "real" result?

chemal
Posts: 776
Joined: 2013/12/08 19:44:49

Re: gfortran help

Post by chemal » 2021/05/10 16:31:02

According to Mathematica, the first 80 digits are

Code: Select all

sin(10) = -0.544021110889369813404747661851377281683643012916223891574184012...

tunk
Posts: 1204
Joined: 2017/02/22 15:08:17

Re: gfortran help

Post by tunk » 2021/05/10 17:51:55

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

Post Reply