List:Internals« Previous MessageNext Message »
From:paul Date:April 14 2005 12:58am
Subject:bk commit - mysqldoc tree (paul:1.2859)
View as plain text  
Below is the list of changes that have just been committed into a local
mysqldoc repository of paul. When paul 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.2859 05/04/13 19:58:02 paul@stripped +1 -0
  manual.texi:
    Add information for ROUND().

  Docs/manual.texi
    1.2694 05/04/13 19:51:50 paul@stripped +36 -1
    Add information for ROUND().

# 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:	paul
# Host:	frost.snake.net
# Root:	/Volumes/frost2/MySQL/bk/mysqldoc

--- 1.2693/Docs/manual.texi	2005-04-13 07:17:35 -05:00
+++ 1.2694/Docs/manual.texi	2005-04-13 19:51:50 -05:00
@@ -50082,12 +50082,47 @@
         -> 20
 @end example
 
-Note that the behavior of @code{ROUND()} when the argument
+Before MySQL 5.0.3, the behavior of @code{ROUND()} when the argument
 is halfway between two integers depends on the C library
 implementation.  Different implementations round to the nearest even number,
 always up, always down, or always toward zero.  If you need
 one kind of rounding, you should use a well-defined function
 such as @code{TRUNCATE()} or @code{FLOOR()} instead.
+
+As of MySQL 5.0.3, @code{ROUND()} uses the precision math library.
+for exact-value arguments:
+
+@itemize @bullet
+
+@item
+For exact-value numbers, @code{ROUND()} uses the "round half up" rule:
+A value with a fractional part of .5 or greater is rounded up to
+the next integer if positive or down to the next integer if negative.
+(In other words, it is rounded away from zero.) A value with a
+fractional part less than .5 is rounded down to the next integer
+if positive or up to the next integer if negative.
+
+@item
+For approximate-value numbers, the result depends on the C library.
+On many systems, this means that @code{ROUND()} uses the "round to nearest
+even" rule: A value with any fractional part is rounded to the
+nearest even integer.
+
+@end itemize
+
+The following example shows how rounding differs for exact and
+approximate values:
+
+@example
+mysql> SELECT ROUND(2.5), ROUND(25E-1);
++------------+--------------+
+| ROUND(2.5) | ROUND(25E-1) |
++------------+--------------+
+| 3          |            2 |
++------------+--------------+
+@end example
+
+For more information, see @ref{precision math}.
 
 @c description_for_help_topic SIGN
 @findex SIGN()
Thread
bk commit - mysqldoc tree (paul:1.2859)paul14 Apr