Home  >  Article  >  Backend Development  >  Logging functions in C#

Logging functions in C#

WBOY
WBOYforward
2023-09-04 11:57:021011browse

C# 中的日志函数

Using C# you can easily work with logarithms. It has the following methods for logarithms and base-10 logarithms.

Serial number Method and description
1 Log(Double)

Returns the natural (base e) logarithm of the specified number.

2 Log(Double, Double)

Returns the specified number at the specified base The logarithm of.

3 Log10(Double)

Returns the base 10 value of the specified number logarithm.

Let’s see an example of using the logarithmic function in C#:

Example

using System;

class Demo {
   static void Main() {
      double val1 = Math.Log(1);
      Console.WriteLine(val1);

      double val2 = Math.Log10(1000);
      Console.WriteLine(val2);

   }
}

The above is the detailed content of Logging functions in C#. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete