C ++でpow()を使用しないコードを書いていますが、理解できないエラーがかなり発生しています。
double power (double X, unsigned int N)
{
double value;
unsigned int i = 1;
for (i = 1, i <= N, i++)
{
result = result * X;
}
if (finite(result))
{
return result;
}
else
{
return INFINITY;
}
}
エラー:
In function 'double power(double, unsigned int)':
Line 5: warning: right-hand operand of comma has no effect
Line 5: error: expected ';' before ')' token
Line 10: error: expected primary-expression before 'if'
Line 10: error: expected ';' before 'if'
Line 10: error: expected primary-expression before 'if'
Line 10: error: expected ')' before 'if'
助けていただければ幸いです、ありがとう。