Home > Article > Backend Development > Logging functions in 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#:
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!