if(A > B, A, B)
But if you need to pick the maximum value of three parameters, it gets a little trickier:
if(A > C, if(A > B, A, B), if(B > C, B, C))
Expanding that to the maximum of four values requires something like the following:
if(A > D, if(A > C, if(A > B, A, B), if(B > C, B, C)), if(D > C, if(D > B, D, B), if(B > C, B, C)))
I am hoping I will not ever need to get the maximum of five or more values.
No comments:
Post a Comment