开心六月综合激情婷婷|欧美精品成人动漫二区|国产中文字幕综合色|亚洲人在线成视频

    1. 
      
        <b id="zqfy3"><legend id="zqfy3"><fieldset id="zqfy3"></fieldset></legend></b>
          <ul id="zqfy3"></ul>
          <blockquote id="zqfy3"><strong id="zqfy3"><dfn id="zqfy3"></dfn></strong></blockquote>
          <blockquote id="zqfy3"><legend id="zqfy3"></legend></blockquote>
          打開APP
          userphoto
          未登錄

          開通VIP,暢享免費電子書等14項超值服

          開通VIP
          math.floor() math.ceil() math.round()
          Math.floor(x)
          功能:對一個數(shù)進行下取整。
          語法:Math.floor(x)
          參數(shù):
          x:一個數(shù)值。
          返回值:返回小于或等于x,并且與之最接近的整數(shù)。
          注:如果x是正數(shù),則把小數(shù)“舍”;如果x是負數(shù),則把小數(shù)“入”。
          例:
          <script type="text/javascript">
          document.write( Math.floor(1.2)+", "+Math.floor(1.8)+", "+Math.floor(-1.2)+", "+Math.floor(-1.8) );
          </script>
          輸出結果為:
          document.write( Math.floor(1.2)+", "+Math.floor(1.8)+", "+Math.floor(-1.2)+", "+Math.floor(-1.8) ); 1, 1, -2, -2
          Math.ceil(x)
          功能:對一個數(shù)進行上取整。
          語法:Math.ceil(x)
          參數(shù):
          x:一個數(shù)值。
          返回值:返回大于或等于x,并且與之最接近的整數(shù)。
          注:如果x是正數(shù),則把小數(shù)“入”;如果x是負數(shù),則把小數(shù)“舍”。
          例:
          <script type="text/javascript">
          document.write( Math.ceil(1.2)+", "+Math.ceil(1.8)+", "+Math.ceil(-1.2)+", "+Math.ceil(-1.8) );
          </script>
          輸出結果為:
          document.write( Math.ceil(1.2)+", "+Math.ceil(1.8)+", "+Math.ceil(-1.2)+", "+Math.ceil(-1.8) ); 2, 2, -1, -1
          Math.round()
          功能:四舍五入取整。
          語法:Math.round(x)
          參數(shù):
          x:一個數(shù)值。
          返回值:與x最接近的整數(shù)。
          例:
          <script type="text/javascript">
          document.write( Math.round(1.2)+", "+Math.round(1.8)+", "+Math.round(-1.2)+", "+Math.round(-1.8) );
          </script>
          輸出結果為:
          document.write( Math.round(1.2)+", "+Math.round(1.8)+", "+Math.round(-1.2)+", "+Math.round(-1.8) ); 1, 2, -1, -2
          本站僅提供存儲服務,所有內容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權內容,請點擊舉報。
          打開APP,閱讀全文并永久保存 查看更多類似文章
          猜你喜歡
          類似文章
          JAVA取整
          php小數(shù)取整的方法
          js只保留整數(shù),向上取整,四舍五入,向下取整等函數(shù)
          js中小數(shù)轉換整數(shù)的方法
          取整,四舍五入取整、向上取整、向下取整、小數(shù)截取
          Python 之 向上取整、向下取整以及四舍五入函數(shù)
          更多類似文章 >>
          生活服務
          分享 收藏 導長圖 關注 下載文章
          綁定賬號成功
          后續(xù)可登錄賬號暢享VIP特權!
          如果VIP功能使用有故障,
          可點擊這里聯(lián)系客服!

          聯(lián)系客服