From: "A.Appleyard" To: DJGPP AT SUN DOT SOE DOT CLARKSON DOT EDU Date: Thu, 11 May 1995 16:30:35 BST Subject: pow() #include main(){int i,j; double x,y; pow(i,j); pow(x,i); pow(x,y);} This program compiled OK. I recompiled it with -E, to get the preprocessed form (i.e. after obeying the #directives), and I found that of gcc's various pow(,) functions, the #included matter only had pow(double,double). That means that all pow(,), even pow(int,int) is called as exp(exponent*log(mantissa)). This is very time-wasting for a small integer exponent obeyed many times. If I instead #include , the #included matter also has pow(long int,long int) and pow(double,long int), so that supposedly pow(,) with integer exponent is obeyed by a quick method. But what actually happens is:- C:\WORK>c:\djgpp\bin\gcc t$1.cc t$1.cc: In function `int main()': t$1.cc:3: call of overloaded `pow' is ambiguous c:/djgpp/cplusinc/builtin.h:47: candidates are: pow(long int, long int) c:/djgpp/cplusinc/builtin.h:46: pow(double, long int) c:/djgpp/include/math.h:120: pow(double, double) t$1.cc:4: call of overloaded `pow' is ambiguous c:/djgpp/cplusinc/builtin.h:47: candidates are: pow(long int, long int) c:/djgpp/cplusinc/builtin.h:46: pow(double, long int) c:/djgpp/include/math.h:120: pow(double, double) How ever can I get all three of these pow(,) functions current at once?, so that any call of pow(,) gets the form that needs the least amount of implicit coercions, like I thought was the rule and the purpose of overloading? ............................................ "He can use `pow' if he wants to, and `eeeeek' amd `zam' and `thud' if he can find a use for them." (from an article in the Algol Bulletin about how to represent the power operator) (Algol was a precursor of C).