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

Experiments with a new algorithm for converting ieee-754 binary64 numbers

into decimal.

FossilOrigin-Name: e923405e448385085224f9289991b303d86b02763535ea77d6fcee98ba6fc1f2
This commit is contained in:
drh
2023-06-30 18:35:43 +00:00
parent 24b368da8d
commit a1b0ff1735
5 changed files with 113 additions and 11 deletions

View File

@@ -1239,6 +1239,7 @@ typedef struct Schema Schema;
typedef struct Expr Expr;
typedef struct ExprList ExprList;
typedef struct FKey FKey;
typedef struct FpDecode FpDecode;
typedef struct FuncDestructor FuncDestructor;
typedef struct FuncDef FuncDef;
typedef struct FuncDefHash FuncDefHash;
@@ -4597,6 +4598,20 @@ struct PrintfArguments {
sqlite3_value **apArg; /* The argument values */
};
/*
** An instance of this object receives the decoding of a floating point
** value into an approximate decimal representation.
*/
struct FpDecode {
char sign; /* '+' or '-' */
char isNan; /* True if not-a-number */
char isInf; /* True if infinity */
int n; /* Significant digits in the decode */
int iDP; /* Location of the decimal point */
char z[24]; /* Significiant digits */
};
void sqlite3FpDecode(FpDecode*,double);
char *sqlite3MPrintf(sqlite3*,const char*, ...);
char *sqlite3VMPrintf(sqlite3*,const char*, va_list);
#if defined(SQLITE_DEBUG) || defined(SQLITE_HAVE_OS_TRACE)