llAbs/ja
< LlAbs
Jump to navigation
Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
LSL ポータル | 関数 | イベント | 型 | 演算子 | 定数 | 実行制御 | スクリプトライブラリ | カテゴリ別スクリプトライブラリ | チュートリアル |
Summary
Function: integer llAbs( integer val );6 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Returns an integer val の絶対値
• integer | val | – | 何らかの integer 値 |
Caveats
- llAbs(-2147483648) の戻り値は -2147483648 になります。これは、正の整数である2147483648がLSLの整数値の許容範囲外であるためです。
Examples
簡単な例
default
{
state_entry()
{
// 戻り値:"The absolute value of -4 is: 4"
llSay(0,"The absolute value of -4 is: "+(string)llAbs(-4) );
}
}
さらに複雑な例
ShowAbsolute(integer X)
{
string Message = "llAbs("
+ (string)X
+ ") --> "
+ (string)llAbs(X);
llSay(PUBLIC_CHANNEL, Message);
}
default
{
state_entry()
{
ShowAbsolute(-3);
ShowAbsolute(5);
ShowAbsolute(-20);
ShowAbsolute(0);
}
}
// 二つ目の例での出力 Test Object: llAbs(-3) --> 3 Test Object: llAbs(5) --> 5 Test Object: llAbs(-20) --> 20 Test Object: llAbs(0) --> 0