! 	This F90 program shows difference in accuracy of complex numbers
!	==============================
        program f90var6
	implicit none

        complex    :: x1, y1, z1
        complex(8) :: x2, y2, z2

! ===================================================
! Multiply single precision complex numbers
! ===================================================
	x1 = (0, 1); y1 = (0, 1); z1 = x1 * y1
	print *
	print *, "Complex: ", x1, " * ", y1, " = ", z1

! ===================================================
! Multiply double precision complex numbers
! ===================================================
	x2 = (0, 1); y2 = (0, 1); z2 = x2 * y2
	print *
	print *, "Complex(8): ", x2, " * ", y2, " = ", z2

! =================================================================
! Shows multiply in single precision complex numbers (no overflow)
! =================================================================
	x1 = (1046529678, 1); y1 = (1046529678, 1); z1 = x1 * y1
	print *
	print *, "Complex: ", x1, " * ", y1, " = ", z1

! ===================================================================
! Shows multiply in double precision complex numbers (more precision)
! ===================================================================
	x2 = (1046529678, 1); y2 = (1046529678, 1); z2 = x2 * y2
	print *
	print *, "Complex(8): ", x2, " * ", y2, " = ", z2

	stop
	end
