开发平台(Platform): (Ex: Win10, Linux, ...)
win7 64bit
编译器(Ex: GCC, clang, VC++...)+目标环境(跟开发平台不同的话需列出)
VC2005
额外使用到的函数库(Library Used): (Ex: OpenGL, ...)
问题(Question):
使用math.h的sqrt(),但回传值错误,ex:sqrt(25.0)=1057620607
不过如果把sqrt()再包过一层,其回传值就会正确,ex:fsqrt(25.0)=5
喂入的资料(Input):
25
预期的正确结果(Expected Output):
5
错误结果(Wrong Output):
1057620607
程式码(Code):(请善用置底文网页, 记得排版,禁止使用图档)
double fsqrt(double x)
{
return sqrt(x);
}
补充说明(Supplement):