On 2005-03-09 17:37:59 +0100, Gabriel Dos Reis wrote: > Vincent Lefevre <[EMAIL PROTECTED]> writes: > | Well, mathematically, you can distinguish these two functions: > | > | powrr: RxR -> R (not defined on (0,0) in particular) > | > | and > | > | powrz: RxZ -> R (where powint(0,0) = 1) > | > | and even other two functions, where R is replaced by C (the complex > | numbers). Unfortunately, the C language doesn't distinguish them. > > That is no reason for the compiler not to distinguish them. There are > plenty of stuff the C language does not distinguish but the compiler > has to.
Do you mean that the compiler should detect if the second argument comes from an integer type? > | Yes, and to compute complex^integer, you need to use cpow(), AFAIK. > > No, you don't need cpow(). >From this point of view, the math library is useless as one can reimplement it entirely. :) > | I think this is the reason why cpow((0,0),(0,0)) should return 1, > | just like pow(0,0). > > That is a bogus reason. No more than any other reason. -- Vincent Lefèvre <[EMAIL PROTECTED]> - Web: <http://www.vinc17.org/> 100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/> Work: CR INRIA - computer arithmetic / SPACES project at LORIA