Grant Goodman must be new here...
No ratings yet!
No if() Only abs()
Here's an intuitive derivation of the solution:
(a+b)/2 gives you the average, which is directly in between a and b, and it is 1/2 the difference from either a or b. So to get to the larger one, just add the difference of the two divided by two, giving you (a+b)/2 + abs(a-b)/2, or (a+b+abs(a-b))/2context