I know it's more about programming, but I can use arithmetic operators only so I think it fits the math community.
2026-03-30 09:55:37.1774864537
get 2 numbers and return the second number with the sign of the first number
19 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
If $x$ is not zero, its sign is $|x|/x$. Thus you'd just need to return $|xy|/x$, where $x$ is the first number, and $y$ is the second number (assuming we don't care about the second number's sign).
E.g. $x=5$ and $y=-3$ gives $|5(-3)|/5 = 3$.
If one of them is zero, I guess it would depend on the application. Do you have a positive/negative zero?