Add return on investment to math#2760
Closed
InukaWijerathna wants to merge 1 commit into
Closed
Conversation
Author
|
Hi! Just checking in to see if there's any update on this PR — happy to make any changes needed to get it merged. Thanks for your time! |
Owner
|
@InukaWijerathna Thanks for the contribution! can you rebase on the current main branch? I think there's a lot of unrelated commits added to this PR |
9944e11 to
8b17348
Compare
Author
|
Done! I've rebased onto the current master branch — the PR now contains only the single commit adding the return on investment function to |
Owner
|
it is such a simple code that I am not sure if it is worth packaging it as a library... sorry about that. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
return_on_investmentto themathmodule.Return on Investment (ROI) is a straightforward but widely used financial formula — it tells you the percentage gain or loss on an investment relative to its cost:
What's included
algorithms/math/return_on_investment.py— typed implementation with full docstring, doctests, andValueErrorfor non-positive costalgorithms/math/__init__.py— export addedChecklist
__init__.pyReference: https://www.investopedia.com/terms/r/returnoninvestment.asp