Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!orc!inews!cmdnfs!bhoughto From: bhoughto@cmdnfs.intel.com (Blair P. Houghton) Newsgroups: comp.lang.c Subject: Re: # to the nth power Message-ID: <866@inews.intel.com> Date: 7 Nov 90 23:23:17 GMT References: <226@smds.UUCP> <8149@star.cs.vu.nl> Sender: news@inews.intel.com Organization: Intel Corp, Chandler, AZ Lines: 46 In article <8149@star.cs.vu.nl> engbert@cs.vu.nl (Engbert Gerrit IJff) writes: >In article , > peter@ficc.ferranti.com (Peter da Silva) writes: >) In article <226@smds.UUCP> rh@smds.UUCP (Richard Harter) writes: >) > for (y=x,sqrtx=1;y>0;) {ysave = y;y =/ 16;sqrtx =* 4;} >) >) This man has been programming in C for a *long* time. I'm impressed. >) (quiz: why do I come to this conclusion?) > >That is an easy quiz. Look at the =/ and =* operators. It's not an easy quiz (though your answer is correct); it's an inside joke. The reason Peter comes to any (discernible) conclusion is so that he can see his (discernible) name in (phosphorescent) lights. :-) Ob. C: Now that the cat's out of the bag, I'd like to point out to the newer C programmers that the assignment operators we know as '+=' et al did used to be usable as '=+' et al. However, it was very long ago[*] that this was changed, and now only the '+=' forms are considered correct. You may (unsettingly often) find a compiler that will accept the obsolete form (properly flagging it with a warning that you're being a crufty old coot :), but ANSI forbids it, and most compilers will call it an error. The reason given most often is that it can confuse such expressions as `x=-y'; is it `x =- y' or `x = -y'? Under maximal-munch[**] it's the former. Under the rules of precedence it's the latter. [*] "...three days after Marconi invented the f*cking thing." -the great Warren Oates in 'Blue Thunder' [**] Maximal munch: if the next n characters are a valid token, and the next n+m characters are also a valid token, consider the longer one to be the token. (Hey, I _did_ say this was for the new guys.) --Blair "Prior art includes Picasso, Michelangelo, _and_ Renoir. Why choose?"