diff options
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/util.c b/src/util.c index a648dc2d1..0950d8427 100644 --- a/src/util.c +++ b/src/util.c @@ -941,6 +941,7 @@ void sqlite3FpDecode(FpDecode *p, double r, int iRound){ int i; u64 v; int e, exp = 0; + p->isSpecial = 0; if( r<0.0 ){ p->sign = '-'; r = -r; @@ -949,8 +950,6 @@ void sqlite3FpDecode(FpDecode *p, double r, int iRound){ p->n = 1; p->iDP = 1; p->z[0] = '0'; - p->isNan = 0; - p->isInf = 0; return; }else{ p->sign = '+'; @@ -958,24 +957,11 @@ void sqlite3FpDecode(FpDecode *p, double r, int iRound){ memcpy(&v,&r,8); e = v>>52; if( (e&0x7ff)==0x7ff ){ - if( v==0x7ff0000000000000L ){ - p->isInf = 1; - p->isNan = 0; - p->z[0] = 'I'; - p->z[1] = 'n'; - p->z[2] = 'f'; - }else{ - p->isInf = 0; - p->isNan = 1; - p->z[0] = 'N'; - p->z[1] = 'a'; - p->z[2] = 'N'; - } - p->n = 3; - p->iDP = 3; + p->isSpecial = 1 + (v!=0x7ff0000000000000L); + p->n = 0; + p->iDP = 0; return; } - p->isNan = p->isInf = 0; /* At this point, r is positive (non-zero) and is not Inf or NaN. ** The strategy is to multiple or divide r by powers of 10 until |