Date: Fri, 1 Oct 1999 16:20:23 -0400 (EDT) From: Daniel Reed Sender: n AT celery DOT n DOT ml DOT org To: djgpp AT delorie DOT com Subject: Re: What is MID() macro ? In-Reply-To: Message-ID: Precedence: first-class MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Fri, 1 Oct 1999, Kevin wrote: ) On Thu, 30 Sep 1999 00:57:43 -0700, Clemens Valens ) 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 The optimist proclaims we live in the best of all possible worlds; the pessimist fears this is true. -- James B. Cabell