diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/printf.c | 2 | ||||
-rw-r--r-- | src/sqliteInt.h | 6 | ||||
-rw-r--r-- | src/util.c | 10 | ||||
-rw-r--r-- | src/vdbe.c | 4 | ||||
-rw-r--r-- | src/vdbemem.c | 2 |
5 files changed, 16 insertions, 8 deletions
diff --git a/src/printf.c b/src/printf.c index 4e7525798..eb90de4d9 100644 --- a/src/printf.c +++ b/src/printf.c @@ -474,7 +474,7 @@ static void vxprintf( if( xtype==etFLOAT ) realvalue += rounder; /* Normalize realvalue to within 10.0 > realvalue >= 1.0 */ exp = 0; - if( sqlite3_isnan(realvalue) ){ + if( sqlite3IsNaN(realvalue) ){ bufpt = "NaN"; length = 3; break; diff --git a/src/sqliteInt.h b/src/sqliteInt.h index d52a04cf1..fd7d7602f 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -11,7 +11,7 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.697 2008/04/28 12:54:15 drh Exp $ +** @(#) $Id: sqliteInt.h,v 1.698 2008/04/28 16:55:26 drh Exp $ */ #ifndef _SQLITEINT_H_ #define _SQLITEINT_H_ @@ -191,8 +191,6 @@ #include <assert.h> #include <stddef.h> -#define sqlite3_isnan(X) ((X)!=(X)) - /* ** If compiling for a processor that lacks floating point support, ** substitute integer for floating-point @@ -1766,6 +1764,8 @@ void *sqlite3DbReallocOrFree(sqlite3 *, void *, int); void *sqlite3DbRealloc(sqlite3 *, void *, int); int sqlite3MallocSize(void *); +int sqlite3IsNaN(double); + char *sqlite3MPrintf(sqlite3*,const char*, ...); char *sqlite3VMPrintf(sqlite3*,const char*, va_list); #if defined(SQLITE_TEST) || defined(SQLITE_DEBUG) diff --git a/src/util.c b/src/util.c index 28cfffa4a..2a7d7a2b0 100644 --- a/src/util.c +++ b/src/util.c @@ -14,7 +14,7 @@ ** This file contains functions for allocating memory, comparing ** strings, and stuff like that. ** -** $Id: util.c,v 1.222 2008/04/16 00:49:12 drh Exp $ +** $Id: util.c,v 1.223 2008/04/28 16:55:26 drh Exp $ */ #include "sqliteInt.h" #include <stdarg.h> @@ -22,6 +22,14 @@ /* +** Return true if the floating point value is Not a Number. +*/ +int sqlite3IsNaN(double x){ + volatile double y = x; + return x!=y; +} + +/* ** Set the most recent error code and error string for the sqlite ** handle "db". The error code is set to "err_code". ** diff --git a/src/vdbe.c b/src/vdbe.c index 78183fcfa..2f027e95c 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -43,7 +43,7 @@ ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** -** $Id: vdbe.c,v 1.735 2008/04/25 12:25:42 drh Exp $ +** $Id: vdbe.c,v 1.736 2008/04/28 16:55:26 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -1195,7 +1195,7 @@ case OP_Remainder: { /* same as TK_REM, in1, in2, out3 */ break; } } - if( sqlite3_isnan(b) ){ + if( sqlite3IsNaN(b) ){ goto arithmetic_result_is_null; } pOut->r = b; diff --git a/src/vdbemem.c b/src/vdbemem.c index f45f38426..9f831ecc9 100644 --- a/src/vdbemem.c +++ b/src/vdbemem.c @@ -482,7 +482,7 @@ void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){ ** manifest type REAL. */ void sqlite3VdbeMemSetDouble(Mem *pMem, double val){ - if( sqlite3_isnan(val) ){ + if( sqlite3IsNaN(val) ){ sqlite3VdbeMemSetNull(pMem); }else{ sqlite3VdbeMemRelease(pMem); |