Skip to content

Implement float math functions for two arrays #1516

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Waterdragen
Copy link
Contributor

Rationale

Since we have something like array.binary_fn(float), we could also have array.binary_fn(array).
Extends functionality of #1042 and #1507

New binary methods for RHS = float

  • atan2

New binary methods for RHS = arrays

  • powi_all
  • powf_all
  • log_all
  • abs_sub_all
  • hypot_all
  • atan2_all

@nilgoyette
Copy link
Collaborator

Can you please add one test for at least one of those functions?

Test a function of: boolean op, unary op, binary op, binary op with arrays
@Waterdragen
Copy link
Contributor Author

Hi there! I've added a test for hypot_all. I've also added tests for boolean, unary, and binary ops for #1042.

@nilgoyette
Copy link
Collaborator

LGTM. I'll leave time for the other maintainers to react, if need be, then I'll merge.

@akern40
Copy link
Collaborator

akern40 commented May 28, 2025

I'm not sure this is the right approach here. If we grant that we want this (and I think we do?) I'd rather we take advantage of generics and traits to make it happen. I had a working example at #1469 of what this might look like.

We also should consider whether a method like this should perform broadcasting for the user or not.

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.

3 participants