Skip to content

Add return on investment to maths#307

Open
InukaWijerathna wants to merge 1 commit into
TheAlgorithms:masterfrom
InukaWijerathna:add/return-on-investment
Open

Add return on investment to maths#307
InukaWijerathna wants to merge 1 commit into
TheAlgorithms:masterfrom
InukaWijerathna:add/return-on-investment

Conversation

@InukaWijerathna
Copy link
Copy Markdown

Description

Adds returnOnInvestment to the maths/ directory.

ROI is one of the most widely used financial metrics — it tells you how profitable an investment is relative to what you spent:

ROI = (Gain - Cost) / Cost × 100

What's included

  • maths/return_on_investment.ts — typed implementation with JSDoc, throws RangeError for non-positive cost

Checklist

  • Follows the code style of the project (arrow function export, JSDoc, RangeError for invalid input)
  • Type annotations for all parameters and return value

Reference: https://www.investopedia.com/terms/r/returnoninvestment.asp

@InukaWijerathna
Copy link
Copy Markdown
Author

InukaWijerathna commented Jun 5, 2026

Closing this for now — needs more work on my end before it's ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant