- 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
Log functions in C#
With C#, you can easily work with Logarithms. It has the following methods for Log as well as Log base 10.
Sr.No | Method & Description |
---|---|
1 | Log(Double) Returns the natural (base e) logarithm of a specified number. |
2 | LogDouble)(Double, Returns the logarithm of a specified number in a specified base. |
3 | Log10(Double) Returns the base 10 logarithm of a specified number. |
Let us see an example to work with Log functions in C# −
Example
using System; class Demo { static void Main() { double val1 = Math.Log(1); Console.WriteLine(val1); double val2 = Math.Log10(1000); Console.WriteLine(val2); } }
Advertisements