DecimalMath.Log Method

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.2

Overload List

Log(Decimal) Returns the natural (base e) logarithm of a specified number.
Log(Decimal, Decimal) Returns the logarithm of a specified number in a specified base.

Log(Decimal)

Returns the natural (base e) logarithm of a specified number.
C#
public static decimal Log(
	decimal value
)

Parameters

value  Decimal
A number whose logarithm is to be found.

Return Value

Decimal
One of the values in the following table. value parameterReturn value Positive The natural logarithm of value; that is, ln value, or log edZero System.Double.NegativeInfinityNegative System.Double.NaNEqual to System.Double.NaNSystem.Double.NaNEqual to System.Double.PositiveInfinitySystem.Double.PositiveInfinity

Exceptions

OverflowException

value is zero.

ArgumentOutOfRangeException

value is less than zero.

Log(Decimal, Decimal)

Returns the logarithm of a specified number in a specified base.
C#
public static decimal Log(
	decimal value,
	decimal newBase
)

Parameters

value  Decimal
A number whose logarithm is to be found.
newBase  Decimal
The base of the logarithm.

Return Value

Decimal
One of the values in the following table. (+Infinity denotes System.Double.PositiveInfinity, -Infinity denotes System.Double.NegativeInfinity, and NaN denotes System.Double.NaN.)anewBaseReturn valuea> 0(0 <newBase< 1) -or-(newBase> 1)lognewBase(a)a< 0(any value)NaN(any value)newBase< 0NaNa != 1newBase = 0NaNa != 1newBase = +InfinityNaNa = NaN(any value)NaN(any value)newBase = NaNNaN(any value)newBase = 1NaNa = 00 <newBase< 1 +Infinitya = 0newBase> 1-Infinitya = +Infinity0 <newBase< 1-Infinitya = +InfinitynewBase> 1+Infinitya = 1newBase = 00a = 1newBase = +Infinity0

Exceptions

OverflowException

value is zero.

ArgumentOutOfRangeException

value is less than zero.

-or-

newBase is less than or equal to zero.

See Also