Unofficial LSL Reference

[[functions:lllog10]]


Unofficial LSL reference

User Tools

Login

You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.

Login

Forgotten your password? Get a new one: Set new password

Function: llLog10

float llLog10(float arg)

Returns the logarithm in base ten of the argument.

Parameters

arg

The float value whose logarithm in base 10 is to be calculated.

Return value

Returns a float with the logarithm in base 10 of the argument.

Notes

  • 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.
  • To calculate the natural logarithm, llLog can be used.
    • To calculate the logarithm in any other base, there is a recipe in the Notes section of 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 (1032). See float for a description of scientific notation.

Short examples

float f;
f = llLog10(10); // sets f to 1
f = llLog10(1);   // sets f to 0
f = llLog10(2);   // sets f to 0.301030 approx.
f = llLog10(0.5); // sets f to -0.301030 approx.
f = llLog10(-1);  // sets f to 0

See also

  • llLog to calculate the natural logarithm.
  • llPow to raise a number to a power (also called antilogarithm).
  • float type and associated caveats and limitations.