JS Float精度问题 toPrecision

<script language="JavaScript">
var r=13.895+Math.pow(10,-3);
alert(r);
alert(r.toPrecision(6)); 
</script>

<script language='VBscript'>
dim r
 r=13.895+0.001
msgbox r ' 13.896
</script>

posted @ 2006-12-13 15:18  RobotTech  阅读(1604)  评论(0编辑  收藏  举报