Min/Max Problems?

After days of staring blankly at four lines of seemingly flawless yet obviously disfunctional code, we discovered that the problem was in our MIN and MAX functions. Turns out MIN gives the max and MAX gives the min? Has anyone else had problems with this? Maybe that makes sense to some people, but doesn’t it seem a bit backwards?

umm… if thats hapening, then there is something wrong with your compiler or code. Why don’t you post some of the faulty/questionable code so i can look it over?


Yeah, it seems kind of odd that MIN returns the maximum of the arguments while MAX returns the minimum, but it makes sense if you think about it in another way:

MIN sets the minimum allowable value of an expression to another value.

MAX sets the maximum allowable value of an expression to another value.

So if you do
a = a + 1 MAX 127
then a will increment, but will never go higher than 127.

Hope that helps you understand.