C# Math Log(Double, Double)

Description

Math Log(Double, Double) returns the logarithm of a specified number in a specified base.

Syntax

Math.Log(Double, Double) has the following syntax.


public static double Log(
  double a,
  double newBase
)

Parameters

Math.Log(Double, Double) has the following parameters.

  • a - The number whose logarithm is to be found.
  • newBase - The base of the logarithm.

Returns

Math.Log(Double, Double) method returns log result.

Example

The following example uses Log to evaluate certain logarithmic identities for selected values.


/*w  w  w  . j  a  va 2  s  .  c  o  m*/
using System;

class LogDLogDD
{
    public static void Main() 
    {
        Console.WriteLine(Math.Log(10,100) );

    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version