Math Functions – LOG10() vs POWER()

I am going to gain ground on completing my short articles on non-trigonometric Transaction SQL math functions. Most, if not all, of these functions have been in the product before the release of SQL Server 2005.

I am very proud of my daughter making the advance math class in sixth grade. I am dedicating these blogs to her hard class work and love of the subject.

Today, I will be exploring the LOG10() and POWER() functions.

The common logarithm of number x is the power y to which 10 would have to be raised to equal x. Before the early 1970’s, handheld electronic calculators were not yet in widespread use. Many math books of that time period had common logarithm tables for reference as appendices. These tables were used in calculating estimates for math on large numbers.

In short, LOG10 is a function that takes large numbers and makes them smaller.

Math-Log10-Graph

The common logarithm of 120 is 2.079181 in which the characteristic is 2 and the mantissa is 0.079181. The inverse function of LOG10(x) is POWER(10, x). Thus, POWER(10, 2.079181) is 119.99993.

These functions take any expression F as input which can be implicitly converted to float. The output of these functions is a floating point number.

The examples below demonstrate various calls to the functions.

The output from the test is listed below.

To summarize, the TSQL language has support for both the common logarithm and power 10 functions.

Related posts

Leave a Comment