数字会被精确到 15 位

  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <h1>JavaScript 数字</h1>
  6.  
  7. <p>整数(不使用指数或科学计数法)会被精确到 15 位:</p>
  8.  
  9. <p id="demo"></p>
  10.  
  11. <script>
  12. var x = 999999999999999;
  13. var y = 9999999999999999;
  14. document.getElementById("demo").innerHTML = x + "<br>" + y;
  15. </script>
  16.  
  17. </body>
  18. </html>