Skip to content

Conversation

@kalenedrael
Copy link
Contributor

std::min and std::max return their second argument if either argument is NAN, while the intrinsics return the first argument. This brings xsimd::{min,max} in line with std::{min,max}, at least on x86.

`std::min` and `std::max` return their second argument if either
argument is NAN, while the intrinsics return the first argument. This
brings `xsimd::{min,max}` in line with `std::{min,max}`, at least on
x86.
@serge-sans-paille
Copy link
Contributor

serge-sans-paille commented Sep 9, 2025 via email

@kalenedrael
Copy link
Contributor Author

Added a test case. I'm not entirely clear on how the architecture-specific tests work though, so let me know if something else needs to be added.

@serge-sans-paille
Copy link
Contributor

Added a test case. I'm not entirely clear on how the architecture-specific tests work though, so let me know if something else needs to be added.

That's fine, thanks. I'll do the portage to other architectures if needs be!

@serge-sans-paille serge-sans-paille merged commit 172041b into xtensor-stack:master Sep 10, 2025
65 checks passed
@kalenedrael
Copy link
Contributor Author

Correction for potential future readers: The first comment has it backwards - std::min and std::max return their first argument if either argument is NAN, while the intrinsics return their second argument.

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.

2 participants