Skip to content

Add return on investment to math#3166

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

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

Conversation

@InukaWijerathna
Copy link
Copy Markdown

Description

Adds return_on_investment to the math/ directory.

Return on Investment (ROI) measures how profitable an investment is relative to its cost:

ROI = (Gain - Cost) / Cost × 100

What's included

  • math/return_on_investment.cpp — implementation under namespace math, with Doxygen documentation, assert-based self-tests, and std::invalid_argument for non-positive cost

Checklist

  • Follows the code style of the project (Doxygen comments, namespace math, assert-based tests, main with test runner)
  • Throws std::invalid_argument for invalid input
  • Self-contained with main() running all tests

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