logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

bk commit into 4.0 tree: msg#00165

Subject: bk commit into 4.0 tree
Below is the list of changes that have just been committed into a
4.0 repository of arjen. When arjen does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
  1.1118 02/07/25 17:04:13 arjen@xxxxxxxxxxxxxxxx +1 -0
  Arjen's LN()/LOG()/LOG2() extensions into manual (with improvements).

  Docs/manual.texi
    1.1056 02/07/25 17:04:08 arjen@xxxxxxxxxxxxxxxx +56 -3
    Arjen's LN()/LOG()/LOG2() extensions into manual (with improvements).

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: arjen
# Host: fred.bitbike.com
# Root: /home/arjen/mysql-4.0

--- 1.1055/Docs/manual.texi     Thu Jul 25 16:46:49 2002
+++ 1.1056/Docs/manual.texi     Thu Jul 25 17:04:08 2002
@@ -32160,17 +32160,58 @@
 mysql> SELECT EXP(-2);
         -> 0.135335
 @end example
+
+@findex LN()
+@item LN(X)
+Returns the natural logarithm of @code{X}:
+@example
+mysql> SELECT LN(2);
+        -> 0.693147
+mysql> SELECT LN(-2);
+        -> NULL
+@end example
+
+This function was added in MySQL version 4.0.3.
+It is synonymous with @code{LOG(X)} in MySQL.
+
 @findex LOG()
 @item LOG(X)
-Returns the natural logarithm of @code{X}:
+@itemx LOG(B,X)
+If called with one parameter, this function returns the natural logarithm
+of @code{X}:
 @example
 mysql> SELECT LOG(2);
         -> 0.693147
 mysql> SELECT LOG(-2);
         -> NULL
 @end example
-If you want the log of a number @code{X} to some arbitrary base @code{B}, use
-the formula @code{LOG(X)/LOG(B)}.
+
+If called with two parameters, this function returns the logarithm of
+@code{X} for an arbitary base @code{B}:
+@example
+mysql> SELECT LOG(2,65536);
+        -> 16.000000
+mysql> SELECT LOG(1,100);
+        -> NULL
+@end example
+
+The arbitrary base option was added in MySQL version 4.0.3.
+@code{LOG(B,X)} is equivalent to @code{LOG(X)/LOG(B)}.
+
+@findex LOG2()
+@item LOG2(X)
+Returns the base-2 logarithm of @code{X}:
+@example
+mysql> SELECT LOG2(65536);
+        -> 16.000000
+mysql> SELECT LOG2(-100);
+        -> NULL
+@end example
+
+@code{LOG2()} is useful for finding out how many bits a number would
+require for storage.
+This function was added in MySQL version 4.0.3.
+In earlier versions, you can use @code{LOG(X)/LOG(2)} instead.
 
 @findex LOG10()
 @item LOG10(X)
@@ -50020,6 +50061,7 @@
 
 @node News-4.0.3, News-4.0.2, News-4.0.x, News-4.0.x
 @appendixsubsec Changes in release 4.0.3
+
 @itemize @bullet
 @item
 Allow @code{DEFAULT} with @code{INSERT} statement.
@@ -50056,7 +50098,18 @@
 non-functional.
 @item
 Added full @code{AUTO_INCREMENT} support to @code{MERGE} tables.
+@item
+Extended @code{LOG()} function to accept an optional arbitrary base
+parameter.
+@xref{Mathematical functions}.
+@item
+Added @code{LOG2()} function (useful for finding out how many bits
+a number would require for storage).
+@item
+Added @code{LN()} natural logarithm function for compatibility with
+other databases. It is synonymous with @code{LOG(X)}.
 @end itemize
+
 
 @node News-4.0.2, News-4.0.1, News-4.0.3, News-4.0.x
 @appendixsubsec Changes in release 4.0.2 (01 July 2002)

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail internals-thread4169@xxxxxxxxxxxxxxx
To unsubscribe, e-mail <internals-unsubscribe@xxxxxxxxxxxxxxx>




<Prev in Thread] Current Thread [Next in Thread>