>Description:
Odd numbers round properly at the half (3.5) but even numbers don't (4.5).
>How-To-Repeat:
mysql> select round(15.5);
+-------------+
| round(15.5) |
+-------------+
| 16 |
+-------------+
1 row in set (0.01 sec)
mysql> select round(16.5);
+-------------+
| round(16.5) |
+-------------+
| 16 |
+-------------+
1 row in set (0.00 sec)
>Fix:
If you only want the integer part without the fraction, you could add a small factor
like '0.01' or smaller if the case warrants.
mysql> select round(16.5 + 0.01);
+--------------------+
| round(16.5 + 0.01) |
+--------------------+
| 17 |
+--------------------+
1 row in set (0.08 sec)
But this slows down processing somewhat.
>Submitter-Id: <submitter ID>
>Originator: User &
>Organization:
>MySQL support: [none | licence | email support | extended email support ]
>Synopsis:
>Severity:
>Priority:
>Category: mysql
>Class:
>Release: mysql-3.23.26-beta (Source distribution)
>Environment:
System: FreeBSD guessware.dyndns.org 4.2-RELEASE FreeBSD 4.2-RELEASE #2: Wed Aug 29
12:51:11 PDT 2001 [EMAIL PROTECTED]:/usr/src/sys/compile/GUESSWARE i386
Some paths: /usr/bin/perl /usr/bin/make /usr/local/bin/gmake /usr/bin/gcc /usr/bin/cc
GCC: Using builtin specs.
gcc version 2.95.2 19991024 (release)
Compilation info: CC='cc' CFLAGS='-O -pipe' CXX='c++' CXXFLAGS=' -O -pipe'
LDFLAGS=''
LIBC:
-r--r--r-- 1 root wheel 1169076 Nov 20 2000 /usr/lib/libc.a
lrwxrwxrwx 1 root wheel 9 Aug 6 05:43 /usr/lib/libc.so -> libc.so.4
-r--r--r-- 1 root wheel 559196 Nov 20 2000 /usr/lib/libc.so.4
Configure command: ./configure --localstatedir=/var/db/mysql --without-perl
--without-debug --without-readline --without-bench --with-mit-threads=no
--enable-assembler --prefix=/usr/local i386--freebsd4.2
Perl: This is perl, version 5.005_03 built for i386-freebsd
---------------------------------------------------------------------
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 <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php