Find the minimum of two values; then find the minimum of your selected minimum and the other value.
If you had a function MIN(a,b) which returned the lesser of two values:
Code:int a, b, c; min = MIN(a, b); min = MIN(min, c); // min is the minimum value.
your min function might do this:
Hope this helps!Code:if (a < b) return a; // a is less than b else return b; // b is less than a OR a = b (they are both the 'min')





Reply With Quote