一般情况下sin30等于0.5,但是我把当我取值时却不是等于0.5,而是0.49999999999999994,又点点偏差,怎么回事呢。代码如下:<html>
<head>
<script language="javascript">
function show()
{ var a;
a=document.qq.aa.value;
document.write(Math.sin(a*Math.PI/180));
}
</script>
</head>
<body>
<form name="qq">
<input type="text" name="aa"><input type="button" onclick="show()">
</form>
</body>
</html>
<head>
<script language="javascript">
function show()
{ var a;
a=document.qq.aa.value;
document.write(Math.sin(a*Math.PI/180));
}
</script>
</head>
<body>
<form name="qq">
<input type="text" name="aa"><input type="button" onclick="show()">
</form>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货