ndarray icon indicating copy to clipboard operation
ndarray copied to clipboard

Implement float math functions for two arrays

Open Waterdragen opened this issue 8 months ago • 4 comments

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

Waterdragen avatar May 28 '25 11:05 Waterdragen

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

nilgoyette avatar May 28 '25 12:05 nilgoyette

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

Waterdragen avatar May 28 '25 14:05 Waterdragen

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

nilgoyette avatar May 28 '25 15:05 nilgoyette

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.

akern40 avatar May 28 '25 21:05 akern40