updated the compound interest example

This commit is contained in:
Luxferre
2025-04-30 11:23:16 +03:00
parent a35163c433
commit e2c881cd2e
3 changed files with 18 additions and 21 deletions
+5 -6
View File
@@ -4,10 +4,9 @@
set 100 0 1 ; store the constant 100 at loc 1
inp 2 3 0 ; prompt for the percentage into loc 2 and the period into loc 3
div 2 1 4 ; divide the percentage value at loc 2 by the constant at loc 1 into loc 4
set 1 0 5 ; set the loc 5 to 1
fma 5 4 5 ; add the constant at loc 5 to the value at loc 4 into loc 5
nel 1 5 5 ; replace loc 5 with its ln
fma 0 3 5 ; replace loc 5 with loc 3 * ln loc 5
nel 0 5 5 ; replace loc 4 with its nexp
div 2 1 5 ; divide the percentage value at loc 2 by the constant at loc 1 into loc 5
inc 5 ; increment loc 5
log 5 5 ; replace loc 5 with its ln
mul 3 5 ; replace loc 5 with loc 3 * ln loc 5
exp 5 5 ; replace loc 5 with its nexp
out 5 5 0 ; output the resulting value