■その他の関数で計算したい

●下のメソッドを計算 
・絶対値 abs() =
・平方根 sqrt() =
・自然対数 log() =
・eの累乗 exp() =
・nのm乗 pow(,) =
・乱数 random() =

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>その他の関数で計算したい</title>
<script type="text/JavaScript">
<!--
function calc() {
document.fm1.abs_ans.value = Math.abs(document.fm1.abs_data.value);
document.fm1.sqrt_ans.value = Math.sqrt(document.fm1.sqrt_data.value);
document.fm1.log_ans.value = Math.log(document.fm1.log_data.value);
document.fm1.exp_ans.value = Math.exp(document.fm1.exp_data.value);
document.fm1.pow_ans.value = Math.pow(document.fm1.pow_data1.value,document.fm1.pow_data2.value);
document.fm1.random_ans.value = Math.random();
}
// -->
</script>
</head>
<body>
<p>■その他の関数で計算したい</p>
<script type="text/JavaScript">
<!--
document.write("<p>●読み出し専用プロパティ<br>");
document.write("・自然対数e (E) = "+Math.E+"<br>");
document.write("・eを底とする2の自然対数 (LN2) = "+Math.LN2+"<br>");
document.write("・eを底とする10の自然対数 (LN10) = "+Math.LN10+"<br>");
document.write("・2を底とするeの対数 (LOG2E) = "+Math.LOG2E+"<br>");
document.write("・10を底とするeの対数 (LOG10E) = "+Math.LOG10E+"<br>");
document.write("・2の平方根 (SQRT2) = "+Math.SQRT2+"<br>");
document.write("・1/2の平方根 (SQRT1_2) = "+Math.SQRT1_2+"<br>");
// -->
</script>
<form name="fm1">
●下のメソッドを計算 <input type="button" value="実行" onclick="calc()"><br>
・絶対値 abs(<input type="text" name="abs_data" size="5" value="-10">) = <input type="text" name="abs_ans" size="5"><br>
・平方根 sqrt(<input type="text" name="sqrt_data" size="3" value="2">) = <input type="text" name="sqrt_ans" size="25"><br>
・自然対数 log(<input type="text" name="log_data" size="3" value="5">) = <input type="text" name="log_ans" size="25"><br>
・eの累乗 exp(<input type="text" name="exp_data" size="3" value="3">) = <input type="text" name="exp_ans" size="25"><br>
・nのm乗 pow(<input type="text" name="pow_data1" size="3" value="2">,<input type="text" name="pow_data2" size="3" value="8">) = <input type="text" name="pow_ans" size="25"><br>
・乱数 random() = <input type="text" name="random_ans" size="25">
</form>

<hr>
</body>
</html>


★解説★