C# | Math.Log10() Method Last Updated : 31 Jan, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report In C#, Math.Log10() is a Math class method. It is used to return the base 10 logarithm of a specified number. Syntax: public static double Log10(double val) Parameter: 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. Example: CSharp // C# program to demonstrate working // of Math.Log10(Double) method using System; class Geeks { // Main Method public static void Main(String[] args) { // double values whose logarithm // to be calculated double a = 4.55; double b = 0; double c = -2.45; double nan = Double.NaN; double positiveInfinity = Double.PositiveInfinity; double negativeInfinity = Double.NegativeInfinity; // Input is positive number so output // will be logarithm of number Console.WriteLine(Math.Log10(a)); // positive zero as argument, so output // will be -Infinity Console.WriteLine(Math.Log10(b)); // Input is negative number so output // will be NaN Console.WriteLine(Math.Log10(c)); // Input is NaN so output // will be NaN Console.WriteLine(Math.Log10(nan)); // Input is PositiveInfinity so output // will be Infinity Console.WriteLine(Math.Log10(positiveInfinity)); // Input is NegativeInfinity so output // will be NaN Console.WriteLine(Math.Log10(negativeInfinity)); } } Output: 0.658011396657112 -Infinity NaN NaN Infinity NaN Reference: https://msdn.microsoft.com/en-us/library/system.math.log10(v=vs.110).aspx Comment More infoAdvertise with us Next Article C# | Math.Log10() Method K Kirti_Mangal Follow Improve Article Tags : Misc C# CSharp-method CSharp-Math Practice Tags : Misc Similar Reads C# | Math.Log() Method In C#, Math.Log() is a Math class method. It is used to return the logarithm of a specified number. This method can be overloaded by changing the number of the arguments passed. There are total 2 methods in the overload list of the Math.Log() method as follows: Math.Log(Double) Method Math.Log(Doubl 4 min read JavaScript Math log10() Method The Javascript Math.log10() is an inbuilt method in JavaScript that gives the value of base 10 logarithms of any number.Syntax:Math.log10(p)Parameters: This method accepts a single parameter p which is any number whose base 10 logarithms is to be calculated.Return Value: It returns the value of base 3 min read C# | Math.Exp() Method In C#, Exp() is a Math class method which is used to return the e raised to the specified power. Here e is a mathematical constant whose value is approximately 2.71828. Exp() is the inverse of Log(). Syntax: public static double Exp (double num); Parameter: num: It is the required number of type Sys 2 min read JavaScript Math log1p() Method Javascript Math.log1p() is an inbuilt function in JavaScript that gives the value of the natural logarithm of 1 + p number. The natural logarithm is of base e, where e is an irrational and transcendental number approximately equal to 2.718. Syntax:Math.log1p(1 + p)Below example illustrate the JavaSc 4 min read JavaScript Math log() Method The JavaScript Math log( ) Method is used to return the natural logarithm (base e) of a number. The JavaScript Math.log() method is equivalent to ln(x) in mathematics. If the value of x is negative, then the math.log() method return NaN. The log() is a static method of Math, therefore, it is always 3 min read Like