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

This is an old revision of the document!


Function: llLog10

float llLog(float arg)

Returns the natural logarithm of the argument.

Parameters

arg

The float value whose natural logarithm is to be calculated.

Result

The natural logarithm 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.

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 = llLog(0.5); // sets f to -0.301030 approx.
f = llLog(-1);  // sets f to 0

See also

  • llLog to calculate the natural logarithm.
  • llPow to raise a number to a power (also called antilogarithm).