相关文章:

JavaScript Math.ceil() 函数详解

代码类型:

杂项:

  • 启用CSS/JS语法检查
  • 监测脚本运行错误
  • 禁止库文件重复

文档类型:

JS库文件:

手动添加:

    1
     
    1
    xxxxxxxxxx
    15
    15
     
    1
    //在当前页面内追加换行标签和指定的HTML内容
    2
    function w( html ){
    3
        document.body.innerHTML += "<br/>" + html;
    4
    }
    5
    6
    7
    w( Math.ceil( 3.14 ) );  // 4
    8
    9
    w( Math.ceil( -0.18 ) ); // 0
    10
    11
    // 如果是整数,则返回其本身
    12
    w( Math.ceil( 5 ) ); // 5
    13
    14
    // 如果无法转换为数字,则返回NaN
    15
    w( Math.ceil( "CodePlayer" ) );  // NaN
    xxxxxxxxxx
    1
    1
     
    1