乗算(2乗,3乗~~~)

int A = (int)Math.pow(num, 2);

第一引数には乗算したい元の値
第二引数にはかける乗(2乗なら「2」)

注意

(int)を書かないとdouble型になるので注意


投稿日

カテゴリー:

, , ,

投稿者:

タグ: