Extend multiply and divide functions to accept scalar values for both arguments#14
Conversation
|
@grimmer0125 First of all, thank you for your hard work on this fork of numjs, it's a valuable resource. I've noticed that the multiply and divide functions currently don't allow scalar values for both a and b arguments, and thought extending this functionality could be useful. I've attached a pull request that makes these changes. Would you mind taking a look? I hope it doesn't create any inconvenience for you. Thank you for considering my contribution. I look forward to your feedback. Best regards 😇 |
This reverts commit 84e7e48.
|
Hi @pppp606, I sincerely apologize for the extremely late response — this PR has been sitting here for over two years, which is unacceptable. I haven't been actively maintaining this project, but that's no excuse for leaving your contribution unreviewed for so long. I've now reviewed your changes, and they look great. The fix is correct — Merging now via squash merge. Thank you for taking the time to contribute, and again, sorry for the delay. |
Summary
This PR aims to extend the functionality of the multiply and divide functions in the numjs library by allowing them to accept scalar numbers for both a and b arguments.
Changes
Updated the type signatures for multiply and divide functions to accept number as a possible type for both a and b parameters.
Why this change is needed
The current implementation of multiply and divide functions allows for a combination of NdArray and scalar numbers, but they don't allow two scalar numbers. By allowing scalar numbers for both arguments, we increase the versatility and user-friendliness of these functions without introducing any breaking changes.
Examples
Before
After