find the natural logarithm of a number in csharp

To find the natural logarithm of a number in C#, you can use the Math.Log() method with the base set to Math.E. Here's an example:

main.cs
double x = 10; // the number you want to find the natural logarithm of
double result = Math.Log(x); // result will be the natural logarithm of x
145 chars
3 lines

In this example, the value of result will be approximately 2.302585.

gistlibby LogSnag