diff options
author | unknown <peter@mysql.com> | 2002-07-17 12:11:48 +0400 |
---|---|---|
committer | unknown <peter@mysql.com> | 2002-07-17 12:11:48 +0400 |
commit | c78629effba2b232c5afada4b2e839a1580c0ea8 (patch) | |
tree | 34ee74d8b2d1d25c28e7b9895fdc0a9bbd5d04ad /Docs/manual.texi | |
parent | 6b3e98d505297e6cbd0cbd22d4f46eacb091d924 (diff) | |
download | mariadb-git-c78629effba2b232c5afada4b2e839a1580c0ea8.tar.gz |
Arjens LOG functions changes with small changes and tests added to mysql-test
Docs/manual.texi:
Manual changes to doccument new functions and function changes
mysql-test/r/func_math.result:
Extend tests for LOG family functions
mysql-test/t/func_math.test:
Extend tests for LOG family functions
sql/gen_lex_hash.cc:
Lex hash changes
sql/item_create.cc:
Rename old log function to ln
sql/item_create.h:
More log functions
sql/item_func.cc:
Implementation of new log function behavior
sql/item_func.h:
Class definition for new functions
sql/lex.h:
Function names
sql/sql_yacc.yy:
Symbols for new LOG function
tests/function.res:
One more test result change
tests/function.tst:
One more test change
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'Docs/manual.texi')
-rw-r--r-- | Docs/manual.texi | 65 |
1 files changed, 60 insertions, 5 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi index 83999b6daae..93272140507 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -31874,17 +31874,57 @@ mysql> SELECT EXP(2); mysql> SELECT EXP(-2); -> 0.135335 @end example -@findex LOG() -@item LOG(X) + +@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([B,]X) +When 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 arbitary base @code{B}, use -the formula @code{LOG(X)/LOG(B)}. + +When 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) @@ -49674,12 +49714,27 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}. @cindex changes, version 4.0 @menu +* News-4.0.3:: Changes in release 4.0.3 * News-4.0.2:: Changes in release 4.0.2 (01 July 2002) * News-4.0.1:: Changes in release 4.0.1 (23 Dec 2001) * News-4.0.0:: Changes in release 4.0.0 (Oct 2001: Alpha) @end menu -@node News-4.0.2, News-4.0.1, News-4.0.x, News-4.0.x +@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 +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) @itemize @bullet |