Mail Archives: djgpp/1999/10/01/16:29:49
On Fri, 1 Oct 1999, Kevin wrote:
) On Thu, 30 Sep 1999 00:57:43 -0700, Clemens Valens
) <c DOT valensNOc DOT SPAM AT mindless DOT com DOT invalid> wrote:
) >See allegro.h. There MID() is defined as follows:
) >#define MID(x,y,z) MAX((x), MIN((y), (z)))
) I think I see now, it returns whichever of x, y or z is the middle
) value.
Maybe that's what it's supposed to do, but if you were to pass 3,2,1 to that
macro, it'd evaluate as follows:
MAX(3, MIN(2, 1))
MAX(3, 1)
3
Passing 1,2,3 or 2,3,1 work as expected, it's just if the first argument is
the largest it will be returned instead of the middle argument.
--
Daniel Reed <n AT ml DOT org>
The optimist proclaims we live in the best of all possible worlds; the pessimist fears this is true. -- James B. Cabell
- Raw text -