Difference between revisions of "LlLog/ja"

From Second Life Wiki
Jump to navigation Jump to search
(New page: {{multi-lang}}{{LSL_Function/ja |func=llLog |func_id=265|func_sleep=0.0|func_energy=10.0 |return_type=float|p1_type=float|p1_name=val |func_footnote=底が10の対数を取得するには{...)
 
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{multi-lang}}{{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
|return_type=float|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''' <= 0 の場合は、代わりに 0.0 を返します。
|return_text='''val'''が0以下の場合は、代わりに0.0を返します。<br />
'''val'''の{{Wikipedia|Natural_logarithm|自然対数}}
|spec
|spec
|caveats
|caveats=
|constants
|constants
|examples=<pre>
|examples=<source lang="lsl2">default
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>
</pre>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llLog10/ja|llLog10]]|}}
|also_functions={{LSL DefineRow||{{LSLG/ja|llLog}}|}}
{{LSL DefineRow||[[llPow/ja|llPow]]|}}
{{LSL DefineRow||{{LSLG/ja|llPow}}|}}
{{LSL DefineRow||[[llSqrt/ja|llSqrt]]|}}
{{LSL DefineRow||{{LSLG/ja|llSqrt}}|}}
|also_events
|also_events
|also_tests
|also_tests
|also_articles={{LSL DefineRow||{{Wikipedia|Natural_logarithm|自然対数}}|}}
|also_articles={{LSL DefineRow||{{Wikipedia|自然対数|lang=ja}}|}}
|notes
|notes=対数関数は {{LSLG/ja|llLog}} と {{LSLG/ja|llLog10}} の 2 つしかありません。浮動小数点数計算の結果発生する誤差は対数処理で最も顕著に現れます。対数の基底変換を行う場合は、 {{LSLG/ja|llLog10}} の代わりに {{LSLG/ja|llLog}} を使うべきです。
<lsl>float LogBaseN = llLog(value) / llLog(Base); //このテクニックは誤差を発生させますが、これが唯一の方法です</lsl>
|permission
|permission
|negative_index
|negative_index
|cat1=Math/ja
|sort=Log10
|cat1=Math
|cat2
|cat2
|cat3
|cat3
|cat4
|cat4
}}
}}

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の関連した項目が参考になるかもしれません。