C# - Math.Log10() Method with Example

In this tutorial, we will learn about the C# Math.Log10() method with its definition, usage, syntax, and example. By Nidhi Last updated : March 29, 2023

C# Math.Log10() Method

The Math.Log10() method is used to get a base 10 logarithm of the specified number.


double Math.Log10(double number);


  • number: The number whose logarithm is to be found.

Return Value

It returns a base 10 logarithm of the given number.

C# Example of Math.Log10() Method

The source code to demonstrate the use of Log10() method of Math class is given below. The given program is compiled and executed successfully.

using System;

class Sample {
  //Entry point of Program
  static public void Main() {
    double log10 = 0.0;

    //Here we get logarithm of base 10 for 90.
    log10 = Math.Log10(90);
    Console.WriteLine("Logarithm of Base 10: " + log10);


Logarithm of Base 10: 1.95424250943932
Press any key to continue . . .

C# Math Class Programs »

Comments and Discussions!

Load comments ↻

Copyright © 2024 www.includehelp.com. All rights reserved.