Skip to content

Polyadic MORTGAGE as an APL2 operator

Vector 18:3, page 46

programming techniques language design

Transcribed from the printed issue; not yet reviewed. Read it in the PDF of the issue, page 46

My idea to resolve the Monthly Discount Rate proposed in Vector Vol.18.1 page 37-38. 74 years old, but not so atrophied, it seems ?

Each IDEAn variable is to be executed (⍎)

Mortgage is an IBM-APL2 operator

Syntax is : LA (LO MORTGAGE) RA
Syntax is : INT (PRIN MORTGAGE) TERM

If ⍴INT ≡ ⍴TERM, it is 2 possibilities :

(.08 .09)(90000 MORTGAGE) 20 25 give a 2×2 Matrix
(.08 .09)(90000 MORTGAGE)¨20 25 give a Vector of 2 terms

      ∇MORTGAGE[⎕]∇
[0]   PMT←INT(PRIN MORTGAGE)TERM;V;W
[1]   ⍝ POLYADIC FUNCTION. VECTOR VOL.18.1
[2]   ⍝ PMT←PRIN÷(V-V*1+12×TERM)÷1-V←÷1+INT÷12 ⍝ PROPOSAL
[3]    V←÷1+INT÷12
[4]    W←V∘.*1+12×TERM
[5]    V←⍉(⌽⍴W)⍴V
[6]    PMT←PRIN÷(V-W)÷1-V
[7]   ⍝ W←(V←÷1+INT÷12)∘.*1+12×TERM ⍝ TWO-
[8]   ⍝ PMT←PRIN÷(V-W)÷1-V←⍉(⌽⍴W)⍴V ⍝ STMT
[9]   ⍝ CHI, SWISS. AN IBM-APL2 OPERATOR.
    ∇ 2001-10-09 21.03.27

      IDEA1
(9÷100)(90000 MORTGAGE)30
      ⍎IDEA1
724.1603553
      IDEA2
(9÷100)(90000 MORTGAGE)15 20 25 30
      ⍎IDEA2
912.8399258 809.7533603 755.2767273 724.1603553
      IDEA3
(8 9 10÷100)(90000 MORTGAGE)15 20 25 30
      ⍎IDEA3
860.0868759 752.7960621 694.6345974 660.3881165
912.8399258 809.7533603 755.2767273 724.1603553
967.1446059 868.5194806 817.830671  789.8144131
      IDEA4
(8 9 10÷100)(90000 MORTGAGE)20 25 30
      ⍎IDEA4
752.7960621 694.6345974 660.3881165
809.7533603 755.2767273 724.1603553
868.5194806 817.830671  789.8144131
      IDEA5
(8 9 10÷100)(90000 MORTGAGE)¨20 25 30
      ⍎IDEA5
752.7960621 755.2767273 789.8144131

      2 3⍴⎕TS
2001 10 9
  21 38 9

CHI - Claude Henriod Informatique