Difference between revisions of "LlLog/ja"

From Second Life Wiki
Jump to navigation Jump to search
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{LSL_Function/ja
{{LSL_Function/ja
|func=llLog
|func_id=264|func_sleep=0.0|func_energy=10.0
|func_id=265|func_sleep=0.0|func_energy=10.0
|func=llLog10|p1_type=float|p1_name=val
|p1_type=float|p1_name=val
|func_footnote=対数を取得するには {{LSLG/ja|llLog}} を用います。<br>llLog10 は基底 10 の対数が必要とされる場所のみ使うべきで、 その他のアプリケーションは全て {{LSLG/ja|llLog}} を代わりに使うべきです。
|func_footnote=底が10の対数を取得するには {{LSLG/ja|llLog10}} を用います。
|func_desc='''val''' の 基底 10 の {{Wikipedia|自然対数|自然対数|lang=ja}} を float で返します。<br/>
|func_desc='''val''' の {{Wikipedia|自然対数|自然対数|lang=ja}} を float で返します。<br/>
'''val''' <= 0 の場合は、代わりに 0.0 を返します。
'''val''' <= 0 の場合は、代わりに 0.0 を返します。
|spec
|spec
|caveats
|caveats=
|constants
|constants
|examples=
|examples=<source lang="lsl2">default
<lsl>
default
{
{
   state_entry()
   state_entry()
Line 17: Line 14:
     float num1 = llFrand(100.0);
     float num1 = llFrand(100.0);


     llOwnerSay("The natural logarithm of " + (string)num1 + " is " + (string)llLog(num1));
     llOwnerSay("The base 10 logarithm of " + (string)num1 + " is " + (string)llLog10(num1));
   }
   }
}
}</source>
</lsl>
|helpers
|helpers
|also_functions={{LSL DefineRow||{{LSLG/ja|llLog10}}|}}
|also_functions={{LSL DefineRow||{{LSLG/ja|llLog}}|}}
{{LSL DefineRow||{{LSLG/ja|llPow}}|}}
{{LSL DefineRow||{{LSLG/ja|llPow}}|}}
{{LSL DefineRow||{{LSLG/ja|llSqrt}}|}}
{{LSL DefineRow||{{LSLG/ja|llSqrt}}|}}
Line 32: Line 28:
|permission
|permission
|negative_index
|negative_index
|sort=Log10
|cat1=Math
|cat1=Math
|cat2
|cat2

Latest revision as of 07:20, 25 February 2016

要約

関数: llLog10( float val );

val の 基底 10 の "Wikipedia logo"自然対数 を float で返します。
val <= 0 の場合は、代わりに 0.0 を返します。

• float val

対数を取得するには llLog を用います。
llLog10 は基底 10 の対数が必要とされる場所のみ使うべきで、 その他のアプリケーションは全て llLog を代わりに使うべきです。

サンプル

default
{
  state_entry()
  {
    float num1 = llFrand(100.0);

    llOwnerSay("The base 10 logarithm of " + (string)num1 + " is " + (string)llLog10(num1));
  }
}

注意点

対数関数は llLogllLog10 の 2 つしかありません。浮動小数点数計算の結果発生する誤差は対数処理で最も顕著に現れます。対数の基底変換を行う場合は、 llLog10 の代わりに llLog を使うべきです。 <lsl>float LogBaseN = llLog(value) / llLog(Base); //このテクニックは誤差を発生させますが、これが唯一の方法です</lsl>

関連項目

関数

•  llLog
•  llPow
•  llSqrt

記事

•  "Wikipedia logo"自然対数

特記事項

Search JIRA for related Issues

Signature

function void llLog10( float val );
この翻訳は 原文 と比べて古いですか?間違いがありますか?読みにくいですか?みんなで 修正 していきましょう! (手順はこちら)
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。