<html>
<head>
<title>对数运算</title>
<script language="JavaScript">
function anylog(form)
{
var a = eval_r(form.a.value);
var b = eval_r(form.b.value);
var c = (Math.log(b))/(Math.log(a))
var d = Math.round(1000000*c)/1000000
form.z.value = d
}
</script>
</head>
<form>
<table border=3 cellspacing=2cellpadding=5>
<tr>
<td colspan=2align=center>log<sub>A</sub>B</td>
</tr>
<tr>
<tdalign=center><i>A</i></td>
<tdalign=center><i>B</i></td>
</tr>
<tr>
<tdalign=center><input type=text name=asize=20></td>
<tdalign=center><input type=text name=bsize=20></td>
</tr>
<tr>
<tdalign=center><input type=buttonvalue="计算"onclick="anylog(this.form)"></td>
<tdalign=center><input type=text name=zsize=20></td>
</tr>
</table>
</form>
</body>
</html>
<a href="http://www.webdm.cn">网页代码站</a>- 最专业的代码下载网站 - 致力为中国站长提供有质量的代码!
logAB | |
A | B |
http://www.webdm.cn">网页代码站- 最专业的代码下载网站 - 致力为中国站长提供有质量的代码!