-1
当我运行我的C代码,包括GCC:错误:无法识别的命令行选项“-1M”
#include <math.h>
,后来在一个向下的循环
distance[i] = (float) pow((float) pow(X1[i] - xpos[i],2)+(float) pow(X2[i] - ypos[i],2),0.5);
,并试图与
编译gcc test.c -o test -1m
我得到的错误
gcc: error: unrecognized command line option ‘-1m’
我是否需要将某些东西下载到我的电脑或其他东西上?
当我在for循环中有一个不同的数学表达式(一个不需要math.h)时,我的代码编译并完美运行。
使用'sqrt(x)而不是'pow(x,0.5)' –