Path: utzoo!utgpu!water!watmath!clyde!rutgers!sri-spam!ames!pasteur!ucbvax!hplabs!hpcea!hpfcdc!hpfelg!jk From: jk@hpfelg.HP.COM (John Kessenich) Newsgroups: comp.lang.c Subject: Re: Re: Power proposal for ANSI C -- we already have what we need Message-ID: <690002@hpfelg.HP.COM> Date: 12 Jan 88 00:50:25 GMT References: <38384@sun.uucp> Organization: HP Elec. Design Div. -FtCollins Lines: 28 I agree that an exponentiation operator makes sense in 'C' for small integer exponents for the many good reasons given elsewhere, and support its addition (but not if it means more delay). Also, its precedence obviously belongs somewhere between that of (not inclusive) unary operators and punctuation operators. But, since exponentiation is not associative, order of evaluation is also important (what is (x ** 2 ** 3) ?). I propose the more mathematically correct interpretation of right to left (as in assignment), not the normal left to right (used for most operators). That is, 3 2 8 6 x ** 2 ** 3 means x which equals x not x thus x ** 2 ** 3 is interpreted as x ** (2 ** 3). By the way, if *^ is adopted for exponents, why not /^ for roots? (don't take this too seriously :-) ). --------------- John Kessenich