Skip to content

Add ReturnOnInvestment to Maths#194

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

Add ReturnOnInvestment to Maths#194
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.

Return on Investment (ROI) is a core financial formula that measures how profitable an investment is relative to its cost:

ROI = (Gain - Cost) / Cost × 100

What's included

  • Maths/ReturnOnInvestment.php — clean typed function with PHPDoc, throws \InvalidArgumentException for non-positive cost

Checklist

  • Follows the code style of the project (typed parameters, PHPDoc block)
  • Throws \InvalidArgumentException for invalid input
  • Strict types enforced

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