VS中pow的使用

来源:互联网 发布:美国js眼部精华霜 编辑:程序博客网 时间:2024/06/03 09:56
VS2005中,数学函数的参数检查更为严格,如pow(2, 45)会引起一个错误提示如下:
error C2668: “pow”: 对重载函数的调用不明确
d:program filesmicrosoft visual studio 8vcincludemath.h(575): 可能是“long double pow(long double,int)”
d:program filesmicrosoft visual studio 8vcincludemath.h(527): 或“float pow(float,int)”
d:program filesmicrosoft visual studio 8vcincludemath.h(489): 或“double pow(double,int)”
试图匹配参数列表“(int, int)”时
正确的使用为pow(2.0, 45)
0 0