Socket
Socket
Sign inDemoInstall

algostrata

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.1.0

22

index.js

@@ -20,3 +20,23 @@ // function savingsAfterYear

// function differenceAfterYearWithFirstYear
// Calculates the difference in accumulated value based on identical returns, but difference in costs, where the first year can have a different cost
//
// Arguments:
// initialValue: Number
// returnPerYear: Number
// baseCostPerYear: Number
// costFirstYear: Number
// newCostPerYear: Number
// atYear: Number
function differenceAfterYearWithFirstYear(initialValue, returnPerYear, baseCostPerYear, newCostFirstYear, newCostPerYear, atYear) {
const baseReturns = (1 + returnPerYear - baseCostPerYear);
const newReturnsFirstYear = (1 + returnPerYear - newCostFirstYear);
const newReturns = (1 + returnPerYear - newCostPerYear);
const differenceInReturnsAtYear = newReturnsFirstYear + Math.pow(newReturns, atYear - 1) - Math.pow(baseReturns, atYear);
return initialValue * differenceInReturnsAtYear;
}
// function valueAtYearWithStandardDeviation

@@ -41,2 +61,2 @@ // Calculates the total value at a year, based on return and standard deviation.

module.exports = { differenceAfterYear, valueAtYearWithStandardDeviation };
module.exports = { differenceAfterYear, differenceAfterYearWithFirstYear, valueAtYearWithStandardDeviation };

2

package.json
{
"name": "algostrata",
"version": "1.0.0",
"version": "1.1.0",
"description": "calculation library for algostrata",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc