Use ideas from T. J. Dekker in "A Floating-Point Technique for Extending the

Available Precision" (1971-07-26) to enhance the accuracy of the SUM()
aggregate function in cases where input magnitudes vary wildly.

FossilOrigin-Name: 439fc00fee62b4db3751860485e21a99cae4fd1f5d911b2c08651a1466245ecc
This commit is contained in:
drh
2023-06-26 19:35:20 +00:00
parent d2b9cdd592
commit 12b198f1a2
5 changed files with 88 additions and 30 deletions
+10
View File
@@ -1234,6 +1234,7 @@ typedef struct Cte Cte;
typedef struct CteUse CteUse;
typedef struct Db Db;
typedef struct DbFixer DbFixer;
typedef struct DblDbl DblDbl;
typedef struct Schema Schema;
typedef struct Expr Expr;
typedef struct ExprList ExprList;
@@ -5035,6 +5036,15 @@ int sqlite3FixSrcList(DbFixer*, SrcList*);
int sqlite3FixSelect(DbFixer*, Select*);
int sqlite3FixExpr(DbFixer*, Expr*);
int sqlite3FixTriggerStep(DbFixer*, TriggerStep*);
/* Representation of an extended precision floating point value.
** The actual value is the sum r and rr. See the dbldbl.c file.
*/
void sqlite3DDFromInt(i64,double*);
void sqlite3DDAdd(double,double,double,double,double*);
void sqlite3DDSub(double,double,double,double,double*);
int sqlite3RealSameAsInt(double,sqlite3_int64);
i64 sqlite3RealToI64(double);
int sqlite3Int64ToText(i64,char*);