aboutsummaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authordrh <>2023-06-30 14:01:09 +0000
committerdrh <>2023-06-30 14:01:09 +0000
commit48114d08cf6b2de4c01f84fd5f91b5ee6ce939a7 (patch)
treeb7051d3ff0ce5f2df8631ce2c3dffb9b2e5feb88 /src/util.c
parentdd8b12a6c5106205de719372bbb8cd242b2e1c7e (diff)
downloadsqlite-48114d08cf6b2de4c01f84fd5f91b5ee6ce939a7.tar.gz
sqlite-48114d08cf6b2de4c01f84fd5f91b5ee6ce939a7.zip
Completely unwind the enhanced precision sum() from [a915f15a916af698] so
as not to offend UBSAN and OSS-Fuzz. FossilOrigin-Name: 85be05b66ef975f02a3e7b2984bcab97d9280c7f3b6ee1e16718de549f240d46
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/util.c b/src/util.c
index ab8560839..abd36eda8 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1750,49 +1750,3 @@ int sqlite3VListNameToNum(VList *pIn, const char *zName, int nName){
|| defined(SQLITE_ENABLE_STMT_SCANSTATUS)
# include "hwtime.h"
#endif
-
-/***************************************************************************
-** Double-Double arithmetic.
-**
-** Reference:
-** T. J. Dekker, "A Floating-Point Technique for Extending the
-** Available Precision". 1971-07-26.
-*/
-
-/* Compute z = (i64)x */
-void sqlite3DDFromInt(i64 x, double *z){
- if( x > -4503599627370496L && x < 4503599627370496 ){
- z[0] = (double)x;
- z[1] = 0.0;
- }else{
- i64 y = x % 2048;
- z[0] = (double)(x - y);
- z[1] = (double)(x - (i64)z[0]);
- }
-}
-
-/* Compute z = x + y */
-void sqlite3DDAdd(double x, double xx, double y, double yy, double *z){
- double r, s;
- r = x + y;
- if( fabs(x)>fabs(y) ){
- s = x - r + y + yy + xx;
- }else{
- s = y - r + x + xx + yy;
- }
- z[0] = r+s;
- z[1] = r - z[0] + s;
-}
-
-/* Compute z = x - y */
-void sqlite3DDSub(double x, double xx, double y, double yy, double *z){
- double r, s;
- r = x - y;
- if( fabs(x)>fabs(y) ){
- s = x - r - y - yy + xx;
- }else{
- s = -y - r + x + xx - yy;
- }
- z[0] = r+s;
- z[1] = r - z[0] + s;
-}