aboutsummaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/util.c b/src/util.c
index 256ec7c5c..ab8560839 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1761,8 +1761,14 @@ int sqlite3VListNameToNum(VList *pIn, const char *zName, int nName){
/* Compute z = (i64)x */
void sqlite3DDFromInt(i64 x, double *z){
- z[0] = (double)x;
- z[1] = (double)(x - (i64)z[0]);
+ 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 */