SQL SERVER – Logarithm Log() – SQL Math Functions @SQLSERVER
LOG() function returns the natural logarithm of the specified float expression. If the expression is integer than it will be converted to a float type implicitly. It also returns a float value.
If the base of the log is not given then it uses the natural logarithm to the base e. e is an irrational constant value.
e ≈ 2.718281828
Logarithms were introduced by John Napier in the early 17th century as a means to simplify calculations. –Wikipedia
Syntax
LOG ( float expression [, base ] )
Example
–Natural Logarithm, without base value select log(2)Output: 0.693147180559945 –Logarithm to the specified base, with base value select log(2, 2) Output: 1 –Logarithm to the specified base, with base value e select log(2, 2.718281828) Output:0.693147180676999
Logarithm is used by navigators, scientists, engineers, and others to perform computations more easily. In publickey cryptography application, discrete logarithm is used to generate keys.
Explore more with Log() function.
Advertisements
Categories: TSQL
log, log math function, logarithm, sql function, TSQL math function
Comments (0)
Trackbacks (2)
Leave a comment
Trackback

December 24, 2012 at 11:24 pmLog10 – SQL Math Functions  SQL Server Rider

December 25, 2012 at 11:37 pmExponential – SQL Math Functions  SQL Server Rider