Click or drag to resize
MathLog Method (Double, Double)
Returns the logarithm of a specified number in a specified base.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static double Log(
	double a,
	double newBase
)

Parameters

a
Type: SystemDouble
A number whose logarithm is to be found.
newBase
Type: SystemDouble
The base of the logarithm.

Return Value

Type: Double
One of the values in the following table. (+Infinity denotes PositiveInfinity, -Infinity denotes NegativeInfinity, and NaN denotes 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
See Also