C# Math Log(Double)

Description

Math Log(Double) returns the natural (base e) logarithm of a specified number.

Syntax

Math.Log(Double) has the following syntax.


public static double Log(
  double d
)

Parameters

Math.Log(Double) has the following parameters.

  • d - The number whose logarithm is to be found.

Returns

Math.Log(Double) method returns One of the values in the following table. d parameter Return value Positive The natural logarithm of d; that is, ln d, or log e d Zero NegativeInfinity Negative NaN Equal to NaN NaN Equal to PositiveInfinity PositiveInfinity

Example

The following example illustrates the Log method.


//from  w  ww  .j  av  a2s  .  c o m
using System;
public class Example
{
   public static void Main()
   {
         Console.WriteLine(Math.Log(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