This commit is contained in:
zeroflag 2021-10-14 14:07:42 +02:00
parent a1ac8378eb
commit 102c4430c0
2 changed files with 2 additions and 2 deletions

View file

@ -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 ;

View file

@ -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<Number> expected) {