I solved the problem, but I wonder if there is a faster way.
Assuming a, b, c are randomly generated numbers, is there a way to find the average using only the Math.max and Math.min functions?
med = Math.max(Math.max(Math.min(a,b),Math.min(b,c)),(Math.max(Math.min(b,c),Math.min(a,c))));
Thank you very much, any answer would be greatly appreciated!
source
share