Path: utzoo!mnetor!uunet!husc6!sri-unix!quintus!ok From: ok@quintus.UUCP (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: min and max Message-ID: <549@cresswell.quintus.UUCP> Date: 19 Jan 88 23:29:31 GMT References: <11182@brl-adm.ARPA> <2197@haddock.ISC.COM> <515@viper.Lynx.MN.Org> Organization: Quintus Computer Systems, Mountain View, CA Lines: 30 Summary: precedence of /\ and \/ In article <515@viper.Lynx.MN.Org>, john@viper.Lynx.MN.Org (John Stanley) writes: > In article <2254@haddock.ISC.COM> karl@haddock.ima.isc.com (Karl Heuer) writes: > >What's the appropriate precedence for these operators? (What was it on those > >compilers that had this extension?) > > The logical place for a min/max operator would be after << >> > and just before the logical <, >, <=, >= operators. > That's exactly where the compiler I used that had them put them. And since /\ is like "and" and \/ is like "or", /\ binds more tightly than \/. Note that /\, \/, and - give you one of the more useful 3-valued logics. {With << tighter-than /\ tighter-than \/ tighter-than <, - is already in the right place for use as the denial operator in this logic.} If you treat > 0 as true, < = as false, and = 0 as unknown, #define THREEVALUED(x) ((!!(X)<<1)-1) /\ | T U F \/ | T U F - | ----|-------------- ----+-------------- ----+---- T | T U F T | T T T T | F U | U U F U | T U U U | U F | F F F F | T U F F | T /\ and \/ are the standard mathematical symbols (albeit as single glyphs rather than digraphs) for minimum and maximum. On a related subject, the DIS 8859/1 character set includes the times (x) and divide (-:-) symbols as single characters. Will it be legal for an otherwise ANSI conforming C compiler to allow these as multiplication and division operators?