Skip to content

Add ReturnOnInvestment to maths#234

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

Add ReturnOnInvestment to maths#234
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 foundational financial metric that quantifies investment profitability as a percentage:

ROI = (Gain - Cost) / Cost × 100

What's included

  • maths/return_on_investment.rb — Ruby class with frozen string literal, raises ArgumentError for invalid cost

Checklist

  • Follows the code style of the project (class with self.call, frozen_string_literal, guard clause)
  • Raises ArgumentError for non-positive cost
  • Uses .to_f to ensure float division

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.

@InukaWijerathna InukaWijerathna closed this by deleting the head repository Jun 5, 2026
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