[JAVA]Mathメソッド


abs():絶対値
Math.abs(-5); // 5
Math.abs(-3.14); // 3.14
Ceil():より大きな整数を二重精度に復元
Math.ceil(5.3); // 6.0
Math.ceil(-5.3); // -5.0
floor():より小さな整数を二重精度に復元
Math.floor(5.3); // 5.0
Math.floor(-5.3); // -6.0
print():最近の整数の実数値を返します.
Math.rint(5.3); // 5.0
Math.rint(5.7); // 6.0
round():四捨五入して長形に戻る
Math.round(5.3); // 5
Math.round(-5.3); // 5
max():2つの数値のうち大きい値を返します.
Math.max(5, 9); // 9
min():2つの数の小さい値を返します
Math.min(5, 9); // 5
pow(a,b):aのb乗
Math.pow(5, 2); // 25.0
sqrt():ルート
Math.sqrt(25); // 5
random():乱順の作成
(int)Math.random()*(끝 정수 - 시작 정수 + 1) + 시작 정수)