C# 7 and .NET: Designing Modern Cross-platform Applications
by Mark J. Price, Ovais Mehboob Ahmed Khan
Logarithms
A logarithm operation is the complete opposite of an exponential operation. The logarithm is a quantity representing the power to which a base number must be raised to produce a given number.
For example, 2x = 32, where x=5, can be represented as log2 32 =5.
In this case, the logarithm of above expression is 5 that represents the power of a fixed number 2 which is raised to produce a given number 32.
Consider a binary search algorithm that works more effectively by splitting the list of an item into two datasets and uses a specific dataset based on the number. For example, say that I have a list of different numbers sorted in ascending order:
{1, 5, 6, 10, 15, 17, 20, 42, 55, 60, 67, 80, 100}
Say that we want to find number ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access