In C#, Math.Log10() is a Math class method. It is used to return the base 10 logarithm of a specified number.
public static double Log10(double val)
val: It is the specified number whose logarithm to be calculated and its type is System.Double.
Return Value: It returns the logarithm of val(base 10 log of val) and its type is System.Double.
Note: Parameter val is always specified as a base 10 number. The return value is depend on the argument passed. Below are some cases:
- If the argument is positive then method will return the natural logarithm or log10(val).
- If the argument is zero, then the result is NegativeInfinity.
- If the argument is Negative(less than zero) or equal to NaN, then the result is NaN.
- If the argument is PositiveInfinity, then the result is PositiveInfinity.
- If the argument is NegativeInfinity, then the result is NaN.
0.658011396657112 -Infinity NaN NaN Infinity NaN
- Difference between Method Overriding and Method Hiding in C#
- C# | Uri.MakeRelativeUri(Uri) Method
- Array.GetValue() Method in C# with Examples | Set - 1
- C# | CharEnumerator.MoveNext() Method
- C# | Math.IEEERemainder() Method
- C# | Substring() Method
- C# | IndexOfAny() Method
- C# | CharEnumerator.GetType() Method
- File.GetLastWriteTimeUtc() Method in C# with Examples
- MathF.Sin() Method in C# with Examples
- Double.CompareTo Method in C# with Examples
- C# | Graphics.DrawLine() Method | Set - 1
- UInt16.GetHashCode Method in C# with Examples
- Stack.Peek Method in C#
- C# | IsNullOrEmpty() Method
- C# | Math.Sign() Method
- Int64.CompareTo Method in C# with Examples
- C# | PadRight() Method
- How to use Array.BinarySearch() Method in C# | Set -1
- C# | EndsWith() Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.