@nexys/math-ts
Version:
[](https://www.npmjs.com/package/@nexys/math-ts) [](https://travis-ci.com/github/Nexysweb/math-ts) [ • 529 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.mortgageMultiplier = (r, n) => {
const d = 1 - Math.pow((1 + r), (-n));
return r / d;
};
exports.mortgageRepayment = (p, r, n) => p * exports.mortgageMultiplier(r, n);
exports.dueAtN = (p, c, r, n) => p * Math.pow((1 + r), n) - c * (Math.pow((1 + r), n) - 1) / r;
exports.interestAtN = (p, c, r, n) => exports.dueAtN(p, c, r, n) * r;
exports.cumulativeInterestAtN = (p, c, r, n) => (p * r - c) * (Math.pow((1 + r), n) - 1) / r + c * n;