ISO/ANSI C syntax:
double pow( double, double );
C++98 Functions:
float std::pow( float, float );
float std::pow( float, int );
double std::pow( double, double );
double std::pow( double, int );
long double std::pow( long double, long double );
long double std::pow( long double, int );
float std::pow( float, int );
double std::pow( double, double );
double std::pow( double, int );
long double std::pow( long double, long double );
long double std::pow( long double, int );
Under C++98 standard, the call std::pow(int, int) will be a compile error.
However, C++0X standard should be able to handle this. C++0X adds the additional overloads sufficient to ensure that:
- If any argument corresponding to a double parameter has type long double, then all arguments corresponding to double parameters are effectively casted to long double.
- Otherwise, if any argument corresponding to a double parameter has type double or an integer type, then all arguments corresponding to double parameters are effectively casted to double.
- Otherwise, all arguments corresponding to double parameters are effectively casted to float.
References:
http://www.daniweb.com/software-development/cpp/threads/108300
No comments:
Post a Comment