Behavior of absolute value, under, and complex numbers #261
Omnikar
started this conversation in
Language Development
Replies: 2 comments
-
Fixed in |
Beta Was this translation helpful? Give feedback.
0 replies
-
It will work with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There is an intuitive behavior of using
⌵ absolute value
and⍜ under
together on a real number; that is, applying the function given tounder
to the positive version of the number, but then leaving it with its original sign. I think the sensible analogue of this for complex numbers would be to maintain the direction of the original complex number, while scaling it to fit the new magnitude outputted by the function given tounder
. Whatever the case, however, the current behavior of combiningunder
,absolute value
, and complex numbers is certainly nonsensical.For example, pass
∘ identity
as the second function to⍜ under
:This code will output
5+¯5i
to the stack. As demonstrated,⍜⌵∘
maintains the sign of each component of the complex number, but replaces both components with the magnitude of the original number.Beta Was this translation helpful? Give feedback.
All reactions