the following program does not work properly. The value of "y2" should be equal
to the value of "y2". The real and the imaginary part of y2 are inverted!!!

        program riemann
        implicit none
        complex (KIND=8) y,y2,imag
        real (KIND=8) theta,dtheta,thetamax,Pi
        integer i,Ntheta
C******************************
        imag=cmplx(0.0d0,1.0d0)
        Pi=dacos(-1.d0)
        Ntheta=100
        thetamax=2.0d0*Pi
        dtheta=thetamax/real(Ntheta)
        do i=1,Ntheta
        theta=i*dtheta
        y=cdexp(imag*theta)**0.5
        y2=cdexp(imag*theta/2.0d0)
C******************************************
        write(10,1000)real(y),aimag(y)
     &,real(y2),aimag(y2)
        end do
        stop
1000    format(10E16.8)
        end program


-- 
           Summary: real and imaginary part of complex exponential
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rbustos76 at yahoo dot com dot ar


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36305

Reply via email to