Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Power operator? Message-ID: <6969@brl-smoke.ARPA> Date: 7 Jan 88 02:21:37 GMT References: <47000029@uxe.cso.uiuc.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 18 In article <47000029@uxe.cso.uiuc.edu> mcdonald@uxe.cso.uiuc.edu writes: >I've been wondering why there is no power operator in C. Did the ANSI >committee consider adding one, and if so, why wasn't it done? Yes, X3J11 considered this and numerous other obvious suggestions for additions to the language. It reaffirmed the original deliberate C design decision to not build in an exponentiation operator, but rather leave it to a library function (pow()). The idea is that an exponentiation operator hides a potentially large amount of computation, which runs counter to "the spirit of C". It is true that (for example) expression ** 2 would be convenient, for much the same reasons as C's op= operators. However, this did not overcome the reasons for the original design. REMINDER: This is my personal opinion. If you feel strongly about this, comment to X3J11 during the second formal public review. Be sure to provide overwhelming reasons for making the change.