1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Whether or not to use the long-double floating point conversion technique

is now a test-control setting.

FossilOrigin-Name: 02ae6caff1f7925c696ad263fe78b1036364d24b6373e1baec10d53aafb14a12
This commit is contained in:
drh
2023-07-03 14:56:49 +00:00
parent 0478d1d88a
commit 1b3c6e727e
9 changed files with 66 additions and 17 deletions

View File

@@ -999,7 +999,7 @@ void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRound){
/* Multiply r by powers of ten until it lands somewhere in between
** 1.0e+19 and 1.0e+17.
*/
if( sizeof(LONGDOUBLE_TYPE)>8 ){
if( sqlite3Config.bUseLongDouble ){
LONGDOUBLE_TYPE rr = r;
if( rr>=1.0e+19 ){
while( rr>=1.0e+119L ){ exp+=100; rr *= 1.0e-100L; }
@@ -1049,7 +1049,7 @@ void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRound){
dekkerMul2(r, rr, 1.0e+01, 0.0, &r, &rr);
}
}
v = (u64)(r)+(u64)(rr);
v = rr<0.0 ? (u64)r-(u64)(-rr) : (u64)r+(u64)rr;
}
@@ -1089,7 +1089,7 @@ void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRound){
}
}
memmove(p->z, &p->z[i+1], p->n);
while( p->n>0 && p->z[p->n-1]=='0' ){ p->n--; }
while( ALWAYS(p->n>0) && p->z[p->n-1]=='0' ){ p->n--; }
}
/*