Path: utzoo!mnetor!uunet!husc6!necntc!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: power operator Message-ID: <2315@haddock.ISC.COM> Date: 18 Jan 88 22:00:32 GMT References: <11182@brl-adm.ARPA> <2197@haddock.ISC.COM> <1409@sugar.UUCP> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 19 In article <1409@sugar.UUCP> peter@sugar.UUCP (Peter da Silva) writes: >In article <2197@haddock.ISC.COM>, karl@haddock.ISC.COM (Karl Heuer) writes: >>[ no power operator in 'C' because] the authors did intentionally avoid >>having nontrivial semantics on the builtin operators. > >That's the core of my objection to structure passing/assignment. The semantics >of a structure copy are pretty complex for an atomic operation. In the general >case they involve a loop. There's a difference of degree. Aggregate copy, even on machines where it isn't a single instruction, is a very simple loop (which can be unrolled, since the size is known at compile-time). The general case of (integer) exponentiation is more complex, assuming you want the O(log n) algorithm rather than the naive O(n). Anyway, that was my perception of the original intent of the authors. I don't think that should be the primary guideline for modern C. Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint