数学関数<math.h>を使うとき
#FAQ
数学関数の平方根 sqrt() などを使う場合は、プログラムファイルに
math.h
をインクルードして(
#include<math.h>
)、コンパイル時に
-lm
オプションをつける.
% cc -lm week8.c
Enter
または
% cc week8.c -lm
Enter
とする。このとき、
-lm
(
マイナス
,
エル
,
エム
) のオプションを付け忘れないように。