summaryrefslogtreecommitdiff
path: root/mysql-test/r/func_math.result
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@sun.com>2009-02-23 14:28:26 +0200
committerAlexey Kopytov <Alexey.Kopytov@sun.com>2009-02-23 14:28:26 +0200
commitcebaf077d2b46496a4a9111244b6412a7ca6b790 (patch)
treec507314a3bdbff4f5bf5079cdf4b16a6899bb25a /mysql-test/r/func_math.result
parent49243dd212989e2c4ae8a7a751238bda606efb65 (diff)
downloadmariadb-git-cebaf077d2b46496a4a9111244b6412a7ca6b790.tar.gz
Fix for bug #15936: "round" differs on Windows to Unix
Both of our own implementations of rint(3) were inconsistent with the most common behavior of rint() on those platforms that have it: round to nearest, break ties by rounding to nearest even. Fixed by leaving just one implementation of rint() in our source tree, and changing its behavior to match the most common native implementations on other platforms.
Diffstat (limited to 'mysql-test/r/func_math.result')
-rw-r--r--mysql-test/r/func_math.result30
1 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index 0d7adbbba5e..87cfb5b86a5 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -360,4 +360,34 @@ SELECT a DIV 2 FROM t1 UNION SELECT a DIV 2 FROM t1;
a DIV 2
0
DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE);
+INSERT INTO t1 VALUES (-1.1), (1.1),
+(-1.5), (1.5),
+(-1.9), (1.9),
+(-2.1), (2.1),
+(-2.5), (2.5),
+(-2.9), (2.9),
+# Check numbers with absolute values > 2^53 - 1
+# (see comments for MAX_EXACT_INTEGER)
+(-1e16 - 0.5), (1e16 + 0.5),
+(-1e16 - 1.5), (1e16 + 1.5);
+SELECT a, ROUND(a) FROM t1;
+a ROUND(a)
+-1.1 -1
+1.1 1
+-1.5 -2
+1.5 2
+-1.9 -2
+1.9 2
+-2.1 -2
+2.1 2
+-2.5 -2
+2.5 2
+-2.9 -3
+2.9 3
+-1e+16 -10000000000000000
+1e+16 10000000000000000
+-1e+16 -10000000000000002
+1e+16 10000000000000002
+DROP TABLE t1;
End of 5.0 tests