Home > Backend Development > C#.Net Tutorial > Logging functions in C#

Logging functions in C#

WBOY
Release: 2023-09-04 11:57:02
forward
1015 people have browsed it

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);

   }
}
Copy after login

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

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template