summaryrefslogtreecommitdiffstats
path: root/test/func.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 17:30:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 17:30:14 +0000
commit30fbe79b8982a0d592ceff1f35038a83807a5e3b (patch)
treeec0680f5cd4232878365ff07b42e860a3da6178b /test/func.test
parentAdding debian version 3.45.2-1. (diff)
downloadsqlite3-30fbe79b8982a0d592ceff1f35038a83807a5e3b.tar.xz
sqlite3-30fbe79b8982a0d592ceff1f35038a83807a5e3b.zip
Merging upstream version 3.45.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/func.test')
-rw-r--r--test/func.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/func.test b/test/func.test
index c7b8f72..a3ecd4e 100644
--- a/test/func.test
+++ b/test/func.test
@@ -1561,4 +1561,25 @@ do_execsql_test func-38.100 {
WITH t1(x) AS (VALUES(-9e+999)) SELECT sum(x), avg(x), total(x) FROM t1;
} {Inf Inf Inf -Inf -Inf -Inf}
+# 2024-03-21 https://sqlite.org/forum/forumpost/23b8688ef4
+# Another problem with Kahan-Babushka-Neumaier summation and
+# infinities.
+#
+do_execsql_test func-39.101 {
+ WITH RECURSIVE c(n) AS (VALUES(1) UNION ALL SELECT n+1 FROM c WHERE n<1)
+ SELECT sum(1.7976931348623157e308),
+ avg(1.7976931348623157e308),
+ total(1.7976931348623157e308)
+ FROM c;
+} {1.79769313486232e+308 1.79769313486232e+308 1.79769313486232e+308}
+for {set i 2} {$i<10} {incr i} {
+ do_execsql_test func-39.[expr {10*$i+100}] {
+ WITH RECURSIVE c(n) AS (VALUES(1) UNION ALL SELECT n+1 FROM c WHERE n<$i)
+ SELECT sum(1.7976931348623157e308),
+ avg(1.7976931348623157e308),
+ total(1.7976931348623157e308)
+ FROM c;
+ } {Inf Inf Inf}
+}
+
finish_test