Skip to content
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

Add rem function #58

Open
cmccomb opened this issue Feb 2, 2025 · 2 comments
Open

Add rem function #58

cmccomb opened this issue Feb 2, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@cmccomb
Copy link
Member

cmccomb commented Feb 2, 2025

Add function like MATLAB's rem

@cmccomb cmccomb added the enhancement New feature or request label Feb 2, 2025
@AugLuk
Copy link

AugLuk commented Feb 15, 2025

Greetings 👋
I'd love to contribute

I'm working on rem, mod and idivide.
The solution is easily extendable to other basic operations with similar format. For example, it could be extended to addition.

The behavior expectations are not very clear to me.
For now, I used "Inputs with Compatible Sizes" > "2-D Inputs" section from this site as the reference. The 2 inputs can be numbers or number matrices, and the output is a float or a float matrix. For example:

rem(5, 3) == 2.0
rem([[1.0], [5.0], [11]], [[3, 8.0]]) == [[1.0, 1.0], [2.0, 5.0], [2.0, 3.0]]

The solution does not currently work with any inputs that are not specified in the section. For example, 1D arrays:

rem([3.0, 4.0, 5.0], 2.0) // error

Is this ok? I can make changes 🙂

@cmccomb
Copy link
Member Author

cmccomb commented Feb 16, 2025

Your contributions are very welcome! Please feel free to start a draft PR for #55, #56, and #57.

You're right that there aren't clear expectations around behavior as this project was a bit ad hoc to begin with. I think the "2-D Inputs" section that you identified is a good standard to target for further development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants