Path: utzoo!mnetor!uunet!husc6!yale!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: pow again (Complex valued or partially defined?) Message-ID: <7071@brl-smoke.ARPA> Date: 13 Jan 88 07:14:12 GMT References: <629@PT.CS.CMU.EDU> <5825@sol.ARPA> Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 27 In article <5825@sol.ARPA>, quiroz@cs.rochester.edu (Cesar Quiroz) writes: > There is no such thing as a unique, universally accepted > definition for the exponentiation. I don't buy this. I was under the impression that in the complex number field, which is the natural extension of the reals and therefore also of the integers, there was a single, well-defined (not necessarily well-behaved!), universally agreed-upon mathematical meaning for "w raised to the power z". If this isn't so, please elaborate. By the way, C does have what you labeled as expt-, the pow() function, even though its domain was restricted so that the result wouldn't be a complex number. I think the error domain of pow() is clear: anything that would have a result not representable as a double, basically, plus some arguments that are representable but wouldn't be correctly computed by the use of log() followed by exp() that is the usual implementation of pow(). The latter exclusion is unfortunate. > All in all, I don't think C as now exists can host a > decent implementation of exponentiation as a single function. Right! But all we have is pow(), unless we provide our own RPow() (real-to-integer, more generally useful than the LPow() I posted, which can be turned into RPow() easily enough) or write more involved code than should have been necessary.