Message-ID: From: Shawn Hargreaves To: djgpp AT delorie DOT com Subject: Re: What is MID() macro? Date: Fri, 1 Oct 1999 09:48:53 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="iso-8859-1" Reply-To: djgpp AT delorie DOT com Davin McCall writes: >> #define MID(x,y,z) MAX((x), MIN((y), (z))) > > Surely, if 'x' is the greatest value, this won't work.. It's a clamping function, used to restrict a variable to a legal range. So x and z should be the constant limits, with x < z, and y the variable being clamped. Shawn Hargreaves.