Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!caip!ut-sally!seismo!brl-adm!brl-smoke!smoke!gwyn@brl.arpa From: gwyn@brl.arpa (VLD/VMB) Newsgroups: net.lang.c Subject: Re: non-built-in exponentiation (Re: What should be added to C) Message-ID: <1595@brl-smoke.ARPA> Date: Mon, 23-Jun-86 15:56:12 EDT Article-I.D.: brl-smok.1595 Posted: Mon Jun 23 15:56:12 1986 Date-Received: Sat, 28-Jun-86 07:43:35 EDT Sender: news@brl-smoke.ARPA Lines: 13 I wrote exponent % 2 because that was what I meant. If your compiler cannot optimize expr % 2 == 0 to use a low-order bit test (two's complement only!), then perhaps you should get somebody to improve your compiler. (The SVR2 VAX PCC generates remarkably ugly code for this, by the way.) I'm a software engineer, not a speed phreak; I prefer code to be correct regardless of any particular machine architecture. The algorithm I posted is so much more efficient than the "obvious" method that concerns for microefficiency are relatively unimportant.