-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
math: Add cumprod and cumproded #23416
Conversation
Sorry for the inactivity on the PR, I've been away from Nim for the last few months. |
Reason for acceptance: We already have |
Thanks for your hard work on this PR! Hint: mm: orc; opt: speed; options: -d:release |
Thanks! |
This pull request adds the `cumproded` function along with its in-place equivalent, `cumprod`, to the math library. These functions provide functionality similar to `cumsum` and `cumsummed`, allowing users to calculate the cumulative sum of elements. The `cumprod` function computes the cumulative product of elements in-place, while `cumproded` additionally returns the prod seq. (cherry picked from commit 4aff124)
This pull request adds the
cumproded
function along with its in-place equivalent,cumprod
, to the math library. These functions provide functionality similar tocumsum
andcumsummed
, allowing users to calculate the cumulative sum of elements.The
cumprod
function computes the cumulative product of elements in-place, whilecumproded
additionally returns the prod seq.