Path: utzoo!mnetor!uunet!dalcs!garfield!john13 From: john13@garfield.UUCP (John Russell) Newsgroups: comp.lang.c Subject: Re: Power operator? Message-ID: <4370@garfield.UUCP> Date: 12 Jan 88 15:14:20 GMT References: <11169@brl-adm.ARPA> Reply-To: john13@garfield.UUCP (John Russell) Distribution: na Organization: Memorial University of Newfoundland, St. John's Lines: 21 In article <11169@brl-adm.ARPA> V4039%TEMPLEVM.BITNET@CUNYVM.CUNY.EDU (Stan Horwitz) writes: >The question still stands. Why does C have no symbol to serve as a power >operator. There are so many symbols to use, and it would be easy to implement. Because there are *so many* different ways to implement it, each optimal for specific cases. 2 ^ (int) with shifts; this is what I use most frequently and there _is_ an operator for it (<< and >>). (int) ^ (int) with various algorithms depending on the size of the exponent. (double) ^ (double) as pow() does it I rarely use, but you can see it requires a different approach to deal with the fractional exponent. John -- "Operating systems room, prepare for shutdown." "I never thought I'd be HAPPY to see our ratings do DOWN!" -- lots of these were sprinkled throughout the last broadcast episode of _Max_Headroom_