! complx.f90 show type complex and arithmetic program complx implicit none complex :: z = (2.0, 3.0); ! complex constant complex :: z2 = cmplx(2.0,3.0) ! construct complex print *, 'complx.f90 starting' print *, z, ' = z' ! output print *, z2, ' = z2' z2 = z * z - z; ! normal complex arithmetic ! also provided: ! functions: real, aimag, abs, conjg ! operators: + - * / ** print *, z2, ' = z2 = z * z - z' print *, 'complx.f90 finishing' ! elementary functions include: ! sin, cos, tan, arcsin, arccos, arctan ! sqrt, log, exp, ** end program complx ! complx.f90 starting ! (2.000000,3.000000) = z ! (2.000000,3.000000) = z2 ! (-7.000000,9.000000) = z2 = z * z - z ! complx.f90 finishing