我有这个Excel公式:
(Assets*(1+Interest)^(CURRENT{age}+1‐Enrollment{age}))+(Salary*Employee{contribution}+Employer{contribution}))*((1+Interest)^(CURRENT{age}+1‐Enrollment{age})‐(1+Inflation)^(CURRENT{age}+1‐Enrollment{age}))/(Interest‐Inflation)
我试图将其转换为下面的JS公式:
age_assets = (assets*Math.pow(1+interest,age+1-enroll_age))+(salary*(your_contrib+employ_contrib))*(Math.pow(1+interest, age+1-enroll_age)-Math.pow(1+inflation, age+1-enroll_age))/(interest-inflation);
鉴于这些价值观:
// Age
64,
// Retirement age
67,
// Enrollment age
30,
// Assets
10000,
// Interest
.3,
// Salary
100000,
// Your contribution
.10,
// Employer contribution
.03,
// Inflation
.02,
// Retirement type
.85
电子表格的价值要小得多。有没有人看到这两个公式之间有任何不一致之处?我以前从来没有做过这种事。