|
|
1.1 ! root 1: c subroutine tst17 ! 2: parameter(ntest=17) ! 3: c Complex arithmetic ! 4: ! 5: parameter(eps = 2.0e-7) ! 6: c common /t17/c1,c2,c3 ! 7: complex c1,c2,c3 ! 8: c1 = cmplx(3.0,4.0) ! 9: c2 = cmplx(-2.0,1.0) ! 10: c3 = cmplx(1.0,-2.0) ! 11: if( abs(real(c1)-3.0) .gt. eps) call e(1,ntest) ! 12: if( abs(imag(c1)-4.0) .gt. eps) call e(2,ntest) ! 13: if( abs(cabs(c1)-5.0) .gt. eps) call e(3,ntest) ! 14: if( cabs(conjg(c2)-cmplx(-2.0,-1.0)) .gt. eps) call e(4,ntest) ! 15: if( cabs(c1+c2-cmplx(1.0,5.0)) .gt. eps) call e(5,ntest) ! 16: if( cabs(c2*c3-cmplx(0.0,5.0)) .gt. eps) call e(6,ntest) ! 17: if( cabs(c3/c1-cmplx(-0.2,-0.4)) .gt. eps) call e(6,ntest) ! 18: end
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.