Path: utzoo!utgpu!water!watmath!clyde!rutgers!gatech!udel!rochester!PT.CS.CMU.EDU!IUS1.CS.CMU.EDU!edw From: edw@IUS1.CS.CMU.EDU (Eddie Wyatt) Newsgroups: comp.lang.c Subject: Re: pow again (Complex valued or partially defined?) Message-ID: <638@PT.CS.CMU.EDU> Date: 13 Jan 88 20:12:32 GMT References: <629@PT.CS.CMU.EDU> <5825@sol.ARPA> Sender: netnews@PT.CS.CMU.EDU Organization: Carnegie-Mellon University, CS/RI Lines: 52 In article <5825@sol.ARPA>, quiroz@cs.rochester.edu (Cesar Quiroz) writes: > > Abstract-- > There is no such thing as a unique, universally accepted > definition for the exponentiation. The case of > expt0: RealxInteger->Real > is different (in a mathematical way and from optimization > perspectives) from the one of > expt1: RealxReal->Complex > There is no such thing as a satisfactory > expt-: RealxReal->Real > C may either have two functions (pow for expt1 and the > proposed rtp for expt0) or have an operator that lets the > compiler choose statically between the two. In either case, > pow has to be partially defined, because of the lack of complex > arithmetic in the base language. You are wrong. exp: (realXreal) -> real is WELL DEFINED but partial. What does well defined mean in this case : intuitively forever pair (x,y) x,y real, exp(x,y) evaluates a a unique real value or no real value at all. Lets consider the function exp2(complex X complex) -> complex z^x is defined to be e^(x log z) (the logrithm is open to choose). BUT for x integer, e^(x log z) = z**x forever branch of the log function. Where x**n is taken to be defined as : x**n : 1/(x**(-n)) : if (n < 0) x*(x**(n-1)) : if (n > 0) 1 : if (n = 0) What this says is that the definition of z^x is compadable with our definition of z**x when x is an integer. Lets consider the function exp(real X real) -> real y^x is defined to be e^(x log y) for y > 0. A real valued function. exp(y,x) is well defined for both y > 0 and x integer. However in the complex plane, exp(z,x) does not have an expectable definition because of the choose of logs. -- Eddie Wyatt e-mail: edw@ius1.cs.cmu.edu