I have two numbers. I want a smaller number to be subtracted from both values.
x: 1000 y: 200 => result: x = 800 and y = 0.
It seems to me that I'm ugly, so could I do it better?
if (x <= y) { y = y - x; x = 0 } else { x = x - y; y = 0; }
source share