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

Round-trip conversions of real->text->real are now lossless on x64 with GCC.

Untested on other platforms so far.  Still a corner-case problem with round().

FossilOrigin-Name: fd7bd4a59361be41b10522abc212cf56fb5e35b4
This commit is contained in:
drh
2012-06-19 03:35:05 +00:00
parent 72b3fbc7b5
commit 4ef9413028
4 changed files with 10 additions and 17 deletions

View File

@@ -430,6 +430,7 @@ void sqlite3VXPrintf(
}
if( realvalue>0.0 ){
LONGDOUBLE_TYPE scale = 1.0;
while( realvalue>=1e100*scale && exp<=350 ){ scale *= 1e100;exp+=100;}
while( realvalue>=1e64*scale && exp<=350 ){ scale *= 1e64; exp+=64; }
while( realvalue>=1e8*scale && exp<=350 ){ scale *= 1e8; exp+=8; }
while( realvalue>=10.0*scale && exp<=350 ){ scale *= 10.0; exp++; }