Difference between revisions of "LlAbs/ja"

From Second Life Wiki
Jump to navigation Jump to search
m
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{multi-lang}}{{LSL_Function/ja
{{LSL_Function
|func=llAbs
|func=llAbs
|sort=Abs
|func_id=6|func_sleep=0.0|func_energy=10.0
|func_id=6|func_sleep=0.0|func_energy=10.0
|func_footnote
|func_footnote
|p1_type=integer
|p1_type=integer
|p1_name=val
|p1_name=val
|p1_desc=Any integer value
|p1_desc=何らかの integer
|return_type=integer
|return_type=integer
|return_text='''val'''の整数
|return_text='''val''' の絶対値
|spec
|spec
|caveats=*-2147483648のllAbsは-2147483648で、これはなぜなら2147483648は有効なinteger値ではないからです。
|caveats=*llAbs(-2147483648) の戻り値は -2147483648 になります。これは、正の整数である2147483648がLSLの{{LSLGC|Integer|整数値}}の許容範囲外であるためです。
|examples=<lsl>
|examples=簡単な例 <source lang="lsl2">
// Here is a simple example.
default
default
{
{
     state_entry()
     state_entry()
     {
     {
        // 戻り値:"The absolute value of -4 is: 4"
         llSay(0,"The absolute value of -4 is: "+(string)llAbs(-4) );
         llSay(0,"The absolute value of -4 is: "+(string)llAbs(-4) );
     }
     }
}
}</source>
</lsl>
さらに複雑な例
 
<source lang="lsl2">
<lsl>
// Here's a more elaborate example.
ShowAbsolute(integer X)
ShowAbsolute(integer X)
{
{
Line 41: Line 38:
         ShowAbsolute(0);
         ShowAbsolute(0);
     }
     }
}
}</source>
</lsl>


<lsl>
<pre>
// Here's the output produced by the more elaborate example:
// 二つ目の例での出力
Test Object: llAbs(-3) --> 3
Test Object: llAbs(-3) --> 3
Test Object: llAbs(5) --> 5
Test Object: llAbs(5) --> 5
Test Object: llAbs(-20) --> 20
Test Object: llAbs(-20) --> 20
Test Object: llAbs(0) --> 0
Test Object: llAbs(0) --> 0
</lsl>
</pre>
|helpers
|helpers
|also_header
|also_header
Line 56: Line 52:
|also_articles
|also_articles
|also_footer
|also_footer
|also_functions={{LSL DefineRow||{{LSLG/ja|llFabs}}|llAbsの{{LSLG/ja|float}}版}}
|also_functions={{LSL DefineRow||{{LSLG/ja|llFabs}}|llAbs の {{LSLG/ja|float}} 版}}
|also_events
|also_events
|also_articles={{LSL DefineRow||{{Wikipedia|Absolute_value}}|}}
|also_articles={{LSL DefineRow||{{Wikipedia|1=絶対値|lang=ja}}|}}
|notes
|notes
|cat1=Math/ja
|cat1=Math
|cat2
|cat2=Integer
|cat3
|cat3
|cat4
|cat4
}}
}}

Latest revision as of 19:36, 4 August 2021

Summary

Function: integer llAbs( integer val );
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

See Also

Functions

•  llFabs llAbs の float

Articles

•  "Wikipedia logo"絶対値

Deep Notes

Signature

function integer llAbs( integer val );