I've solved the problem, but I'm wondering if there is a faster way.
Assuming a, b, c are randomly generated numbers, is there a way to find the middle number by only using 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))));
Thanks a lot, any response would be greatly appreciated!
what about the following?
min(min(max(a,b), max(b,c)), max(a,c))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With