Uh oh!
There was an error while loading. Please reload this page.
Add support for copysign to the specification - #693
Conversation
rgommers
commented
Sep 26, 2023
Yes, because real-valued floating-point dtypes is all that's in C99.
If it's supported by all libraries, then it should be fine I think. I quickly checked NumPy, PyTorch and JAX, all three seem to support it. |
I see nothing wrong with "supporting" signed NaNs. In practice, I doubt libraries take care with having meaningful signs. Python The C EDIt: To be clear, the C macro is not just theoretical, a negative sign is actually typical EDIT2: But if anyone has a problem with supporting it on some hardware, then I guess can just add a note for that. |
kgryte
commented
Oct 18, 2023
@seberg To clarify, while |
kgryte
commented
Oct 18, 2023
As this PR has been reviewed and discussed without objections, will go ahead and merge. Any subsequent revisions can be addressed in follow-up PRs... |
asmeurer
commented
Apr 19, 2024
I'm curious, do you know if this is guaranteed by the language, or does it just happen to be true for all implementations? |
seberg
commented
Apr 20, 2024
CPython ensures this and I am pretty sure even tests for it (I has once looked at simplifying the code responsible). I.e., IIRC, we can rely on Mark Dickinson to ensure this. |
This PR
copysignfunction to the standard #593 by adding support for composing a floating-point value having the magnitude ofx1_iand the sign ofx2_ifor each element inx1_i.NaNmay be manipulated.Questions