LlCeil

来自人工智能助力教育知识百科
跳转至: 导航搜索

Template:Needs Translation/

函数名
Function:integer llCeil(float val);
参数:Float val-任何有效的 float 值
返回值:返回一个整数,该整数值是向正无穷大舍入的 val 值(返回 val)
注意事项
如果算术结果超出有效整数的范围(- 2147483648至2147483647) ,则返回值为-2147483648(ox80000000)
示例

default
{
   state_entry()
   {
       llSay(0, "The ceil value of -4.5 is: " + (string)llCeil(-4.5));
//              "The ceil value of -4.5 is: -4"
 
       llSay(0, "The ceil value of -4.9 is: " + (string)llCeil(-4.9));
//              "The ceil value of -4.9 is: -4"
 
       llSay(0, "The ceil value of -4.1 is: " + (string)llCeil(-4.1));
//              "The ceil value of -4.1 is: -4"
 
       llSay(0, "The ceil value of 4.5 is: " + (string)llCeil(4.5));
//              "The ceil value of 4.5 is: 5"
 
       llSay(0, "The ceil value of 4.9 is: " + (string)llCeil(4.9));
//              "The ceil value of 4.9 is: 5"
 
       llSay(0, "The ceil value of 4.1 is: " + (string)llCeil(4.1));
//              "The ceil value of 4.1 is: 5"
    }
}

相关函数
llRound - 将浮点数舍入到最接近的整数

llFloor - 将浮点数调整为负无穷大

相关事件