You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.
This shows you the differences between two versions of the page.
functions:lllog10 [2014-05-16 07:59 SLT] sei created |
functions:lllog10 [2015-02-04 08:15 SLT] (current) sei style |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | $nav | ||
===== Function: llLog10 ===== | ===== Function: llLog10 ===== | ||
<code lsl2> | <code lsl2> | ||
- | float llLog(float arg) | + | float llLog10(float arg) |
</code> | </code> | ||
- | Returns the natural logarithm of the argument. | + | Returns the logarithm in base ten of the argument. |
===== Parameters ===== | ===== Parameters ===== | ||
=== arg === | === arg === | ||
- | The float value whose natural logarithm is to be calculated. | + | The $lty[float] value whose logarithm in base 10 is to be calculated. |
- | ===== Result ===== | + | ===== Return value ===== |
- | The natural logarithm of the argument. | + | Returns a $lty[float] with the logarithm in base 10 of the argument. |
===== Notes ===== | ===== Notes ===== | ||
* In order to make sense, the argument must be greater than 0.0; a value of 0.0 or less yields 0.0. | * In order to make sense, the argument must be greater than 0.0; a value of 0.0 or less yields 0.0. | ||
- | * The function returns **Infinity** if the input is **Infinity**, and 0.0 if the input is **-Infinity** or **NaN**. | + | * The function returns $pinf if the input is $pinf, and 0.0 if the input is $minf or $nan. |
- | * To calculate the natural logarithm, [[llLog]] can be used. | + | * To calculate the natural logarithm, $lfn[llLog] can be used. |
- | * To calculate the logarithm in any other base, there is a recipe in the Notes section of [[llLog]]. | + | * To calculate the logarithm in any other base, there is a recipe in the Notes section of $lfn[llLog]. |
+ | * There is no built-in inverse of this function. To raise 10 to a power, you can use ''llPow(10, power)''. But if you want to raise 10 to an integer constant, better use scientific notation, for example ''1e32'' means 10 to the 32nd power (10<sup>32</sup>). See $lty[float] for a description of scientific notation. | ||
===== Short examples ===== | ===== Short examples ===== | ||
Line 30: | Line 32: | ||
f = llLog10(1); // sets f to 0 | f = llLog10(1); // sets f to 0 | ||
f = llLog10(2); // sets f to 0.301030 approx. | f = llLog10(2); // sets f to 0.301030 approx. | ||
- | f = llLog(0.5); // sets f to -0.301030 approx. | + | f = llLog10(0.5); // sets f to -0.301030 approx. |
- | f = llLog(-1); // sets f to 0 | + | f = llLog10(-1); // sets f to 0 |
</code> | </code> | ||
===== See also ===== | ===== See also ===== | ||
- | * [[llLog]] to calculate the natural logarithm. | + | * $lfn[llLog] to calculate the natural logarithm. |
- | * [[llPow]] to raise a number to a power (also called antilogarithm). | + | * $lfn[llPow] to raise a number to a power (also called antilogarithm). |
+ | * $lty[float] type and associated caveats and limitations. | ||