LlAbs/ja

From Second Life Wiki
< LlAbs
Revision as of 02:47, 14 December 2015 by Mizu Melody (Talk | contribs)

Jump to: navigation, search

Summary

Function: integer llAbs( integer val );

Returns an integer val の絶対値

• integer val 何らかの integer 値

Caveats

  • llAbs(-2147483648) の戻り値は -2147483648 になります。これは 2147483648 が有効な integer 値でないためです。
All Issues ~ Search JIRA for related Bugs

Examples

<lsl>// 簡単な例 default {

   state_entry()
   {
       llSay(0,"The absolute value of -4 is: "+(string)llAbs(-4) );
   }

}</lsl>

<lsl>// さらに複雑な例 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);
   }

}</lsl>

// 二つ目の例での出力
Test Object: llAbs(-3) --> 3
Test Object: llAbs(5) --> 5
Test Object: llAbs(-20) --> 20
Test Object: llAbs(0) --> 0

See Also

Functions

•  llFabs llAbs の float

Articles

•  Wikipedia:絶対値

Deep Notes

Search JIRA for related Issues

Signature

function integer llAbs( integer val );