- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
MathF.Log10() Method in C# with Examples
The MathF.Log10() method in C# is used to return the base 10 logarithm of a specified number.
Syntax
Following is the syntax −
public static float Log10 (float val);
Above, Val is the number whose logarithm is to be calculated.
Example
Let us now see an example to implement the MathF.Log10() method −
using System; public class Demo { public static void Main(){ float val1 = 45.9f; float val2 = -4.35f; Console.WriteLine(MathF.Log10(val1)); Console.WriteLine(MathF.Log10(val2)); } }
Output
This will produce the following output −
1.661813 NaN
Example
Let us now see another example to implement the MathF.Log10() method −
using System; public class Demo { public static void Main(){ float val1 = 1.0f; float val2 = 10.0f; Console.WriteLine(MathF.Log10(val1)); Console.WriteLine(MathF.Log10(val2)); } }
Output
This will produce the following output −
0 1
Advertisements