Output of file : CXARTH.FOR contained in archive : FORTRN77.ZIP
SUBROUTINE CXARTH(A,B,C,N)
C
C THIS SUBROUTINE CXARTH DOES COMPLEX ARITHMETIC INVOLVING
C TWO COMPLEX NUMBERS.
C
C N=2 FOR SUBTRACTION
C N=3 FOR MULTIPLICATION
C N=4 FOR DIVISION
C
DIMENSION A(2), B(2), C(2)
X = B(1)
Y = A(1)
GO TO (1,2,3,4),N
1 C(1) = X + Y
C(2) = A(2) + B(2)
RETURN
2 C(1) = Y - X
C(2) = A(2) - B(2)
RETURN
3 C(1) = Y*X - A(2)*B(2)
C(2) = A(2)*X + Y*B(2)
RETURN
4 G = X*X + B(2)*B(2)
C(1) = (Y*X + A(2)*B(2))/G
C(2) = (A(2)*X - Y*B(2))/G
RETURN
END



### 3 Responses to “Category : Miscellaneous Language Source CodeArchive   : FORTRN77.ZIPFilename : CXARTH.FOR”

1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/