diff --git a/src/main/res/raw/ops.forth b/src/main/res/raw/ops.forth index 20c8080..c1ccab5 100644 --- a/src/main/res/raw/ops.forth +++ b/src/main/res/raw/ops.forth @@ -26,7 +26,7 @@ : fire ( monthly-expense real-interest-rate -- money-needed ) 100 / swap 12 * swap / ; : ri ( nominal-interest-rate inflation-rate -- real-interest-rate ) 100 / 1+ swap 100 / 1+ swap / 1- 100 * ; : cagr ( bv ev n -- p ) 1 swap / >r swap / r> pow 1- 100 * ; -: ggm ( cf r g -- pvg ) 100 / swap 100 / swap - / ; +: iv ( cf r g -- pvg ) 100 / swap 100 / swap - / ; ( trigonometry ) : pi ( n -- n ) :java.lang.Math/PI jvm-static-var ; : sin ( n -- n ) :java.lang.Math/sin/d jvm-call-static ; diff --git a/src/test/java/com/vectron/fcl/FclTest.java b/src/test/java/com/vectron/fcl/FclTest.java index db55a3c..23bfe4e 100644 --- a/src/test/java/com/vectron/fcl/FclTest.java +++ b/src/test/java/com/vectron/fcl/FclTest.java @@ -239,7 +239,7 @@ public class FclTest { assertEquals(1.96, evalPop("4 2 ri").doubleValue(), 0.01); assertEquals(23.8562, evalPop("10000 19000 3 cagr").doubleValue(), 0.01); assertEquals(24389.07, evalPop("100000 7 5 pmt").doubleValue(), 0.01); - assertEquals(41.67, evalPop("2.5 11 5 ggm").doubleValue(), 0.01); + assertEquals(41.67, evalPop("2.5 11 5 iv").doubleValue(), 0.01); } private void evalDoubles(String script, List expected) {