Path: utzoo!mnetor!uunet!husc6!rutgers!dayton!viper!john From: john@viper.Lynx.MN.Org (John Stanley) Newsgroups: comp.lang.c Subject: Re: min and max Message-ID: <515@viper.Lynx.MN.Org> Date: 18 Jan 88 18:51:25 GMT References: <11182@brl-adm.ARPA> <2197@haddock.ISC.COM> <518@cresswell.quintus.UUCP> <2254@haddock.ISC.COM> Reply-To: john@viper.UUCP (John Stanley) Organization: DynaSoft Systems Lines: 33 In article <2254@haddock.ISC.COM> karl@haddock.ima.isc.com (Karl Heuer) writes: > >Okay, as long as you're careful not to put "/\" at the end of a line. >(ANSI Backslash continuation occurs before token scanning!) For this reason, and that \/ is going to get converted to / in too many cases, I doubt this notation will ever be added. Note that I said "notation".. I would -love- to have the functionality and I still think it can be done. How about #< (numerical lesser) or #> (numerical greater) for min and max? Last time I looked '#' wasn't being used for any C operator.... >Of course, the assignment operators /\= and \/= would be great. Think of all >the times you've ever written "if (x > xmax) xmax = x;". Far, far too many times... Yes, it would be VERY nice to have a min/max operator for things like this. It's such an integral part of things we do all the time there really should be some easier way to express it within the language. >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. --- John Stanley (john@viper.UUCP) Software Consultant - DynaSoft Systems UUCP: ...{amdahl,ihnp4,rutgers}!meccts!viper!john