The COS function returns the trigonometric cosine of a REAL or COMPLEX argument.
x is an INTENT(IN) scalar or array of type REAL or COMPLEX and must be expressed in radians.
The result is of the same type and kind as x. Its value is a REAL or COMPLEX representation of the cosine of x.
Examplereal :: x=.5,y(2)=(/1.,1./) complex :: z=(1.,1.) write(*,*) cos(x) ! writes .8775826 write(*,*) cos(y) ! writes .9950042 .9950042 write(*,*) cos(z) ! writes (.8337300. -.9888977)