LlFloor

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

Template:Needs Translation/


函数名
Function: integer llFloor( float val );
参数:float val –任何有效的浮点值
返回值:返回一个整数,该整数是向负无穷取整的val的整数值(返回<=val)。
注意事项
如果算术结果超出有效整数的范围(包括-2147483648到2147483647),则返回值为-2147483648(0x8000000)。
示例
示例1
default
{
   state_entry()
   {
       llSay(0,  "The floor value of -4.5 is: "+(string)llFloor(-4.5) );
       //Returns "The floor value of -4.5 is: -5"
 
       llSay(0,  "The floor value of -4.9 is: "+(string)llFloor(-4.9) );
       //Returns "The floor value of -4.9 is: -5"
 
       llSay(0,  "The floor value of -4.1 is: "+(string)llFloor(-4.1) );
       //Returns "The floor value of -4.1 is: -5"
 
       llSay(0,  "The floor value of 4.5 is: "+(string)llFloor(4.5) );
       //Returns "The floor value of 4.5 is: 4"
 
       llSay(0,  "The floor value of 4.9 is: "+(string)llFloor(4.9) );
       //Returns "The floor value of 4.9 is: 4"
 
       llSay(0,  "The floor value of 4.1 is: "+(string)llFloor(4.1) );
       //Returns "The floor value of 4.1 is: 4"
    }
}
相关函数
llRound – 将浮点数舍入到接近最近整数的整数

llCeil – 将浮点向正无穷大取整

相关事件