Path: utzoo!mnetor!uunet!husc6!mit-eddie!uw-beaver!ssc-vax!cxsea!blm From: blm@cxsea.UUCP (Brian Matthews) Newsgroups: comp.lang.c Subject: Re: Power proposal for ANSI C -- we already have what we need Message-ID: <2324@cxsea.UUCP> Date: 11 Jan 88 16:35:18 GMT References: <38384@sun.uucp> <3812@hoptoad.uucp> Reply-To: blm@cxsea.UUCP (Brian Matthews) Organization: Computer X Inc. Lines: 40 John Gilmore (gnu@hoptoad.uucp) writes: |[Good reasons why function prototypes and a smart compiler make the | pow function just fine...] |Does *anybody* have a problem with this??? I think it would be crazy |to change the standard for something like this. Adding new multi-character |arithmetic operators to the language at the final stage of review? |Be serious. We laughed at ( ), we roared at noalias, who would believe |us if we overloaded ** to mean a crippled float/int-only exponentiation? |we already have one crippled math op (% doesn't work on floats, for no reason), |why add another? I'm sure somebody has a problem with this, but not me. I would be in favor of adding a power operator iff: 1. It works with both integral and floating point types, just like all of the other arithmetic operators (yes, expect %), 2. It followed the same rules in regards to type promotion as the other arithmetic operators, and 3. A syntax is proposed which doesn't break existing code or require the compiler to choose between two different meanings to a statement based upon the types of the operands. This means ** and -> are both unacceptable. I would also say ^^ is unacceptable in the hopes of getting a boolean exclusive-or. 4. A corresponding op= operator was added (i.e. like +=, -=, etc.) In other words, make the exponentiation operator look like part of the language, instead of something hurriedly tacked on. This is especially true when there is already a good way of doing exponentiation, as outlined by John in the article I quoted. -- Brian L. Matthews "A power tool is not a toy. ...{mnetor,uw-beaver!ssc-vax}!cxsea!blm Unix is a power tool." +1 206 251 6811 Computer X Inc. - a division of Motorola New Enterprises