mirror of
https://github.com/zeroflag/fcl.git
synced 2025-01-11 20:01:10 +01:00
ggm->iv
This commit is contained in:
parent
a1ac8378eb
commit
102c4430c0
2 changed files with 2 additions and 2 deletions
|
@ -26,7 +26,7 @@
|
||||||
: fire ( monthly-expense real-interest-rate -- money-needed ) 100 / swap 12 * swap / ;
|
: 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 * ;
|
: 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 * ;
|
: 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 )
|
( trigonometry )
|
||||||
: pi ( n -- n ) :java.lang.Math/PI jvm-static-var ;
|
: pi ( n -- n ) :java.lang.Math/PI jvm-static-var ;
|
||||||
: sin ( n -- n ) :java.lang.Math/sin/d jvm-call-static ;
|
: sin ( n -- n ) :java.lang.Math/sin/d jvm-call-static ;
|
||||||
|
|
|
@ -239,7 +239,7 @@ public class FclTest {
|
||||||
assertEquals(1.96, evalPop("4 2 ri").doubleValue(), 0.01);
|
assertEquals(1.96, evalPop("4 2 ri").doubleValue(), 0.01);
|
||||||
assertEquals(23.8562, evalPop("10000 19000 3 cagr").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(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) {
|
private void evalDoubles(String script, List<Number> expected) {
|
||||||
|
|
Loading…
Reference in a new issue