<script language="JavaScript"> document.write( Math.round(Math.E) + "<br />" ); document.write(Math.round(0.3) + "<br />") document.write( Math.round(0.9) + "<br />" ); document.write( Math.round(-10.5) + "<br />" ); document.write( Math.round(10.5) ); </script>
运行该例子,输出:
3 0 1 -10 11