Collections:
LOG() - Logarithm of Y to Base X
How to calculate the logarithm of a number to a given base number using the LOG() function?
✍: FYIcenter.com
LOG(X, Y) is a MySQL built-in function that calculates the logarithm of Y to base X. For example:
SELECT LOG(2, 1024), LOG(2, 1.4142), LOG(2.718, 0.3679); -- +--------------+--------------------+---------------------+ -- | LOG(2, 1024) | LOG(2, 1.4142) | LOG(2.718, 0.3679) | -- +--------------+--------------------+---------------------+ -- | 10 | 0.4999861644218742 | -1.0000478060991969 | -- +--------------+--------------------+---------------------+
Reference information of the LOG() function:
LOG(Y, X): val Returns the logarithm of X to the base Y. If X is less than or equal to 0, or if Y is less than or equal to 1, then NULL is returned. If called with one parameter Y, this function returns the natural logarithm of Y. Arguments, return value and availability: Y: Required. The base value, if X is provided. It becomes a synonym for LN(Y), if X is not provided. X: Optional. The input value, if provided. val: Return value. The logarithm of the input value. Available since MySQL 4.0.
Related MySQL functions:
⇒ LOG10() - Logarithm to Base 10
2023-11-15, 252🔥, 0💬
Popular Posts:
What is SQL Server Transact-SQL (T-SQL)? SQL Server Transact-SQL, also called T-SQL, is an extension...
What Happens to Your Transactions When ERROR 1205 Occurred in MySQL? If your transaction receives th...
How To Format DATETIME Values to Strings with the CONVERT() Function in SQL Server Transact-SQL? SQL...
How To Use SQL*Plus Built-in Timers in Oracle? If you don't have a stopwatch/timer and want to measu...
What is sqlservr.exe - Process - SQL Server (SQLEX?PRESS) in SQL Server? Process sqlservr.exe is the...