aboutsummaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2008-04-28 16:55:26 +0000
committerdrh <drh@noemail.net>2008-04-28 16:55:26 +0000
commit0de3ae95d5dafdb602f8df24014397b4a63fb0f9 (patch)
tree97328f7e22ca088680d40731b7a1b8b233b54aa5 /src/util.c
parentf51bf48b327afde2a11727f76a0af9c44cbf372c (diff)
downloadsqlite-0de3ae95d5dafdb602f8df24014397b4a63fb0f9.tar.gz
sqlite-0de3ae95d5dafdb602f8df24014397b4a63fb0f9.zip
Change the implementation of the NaN recognition to be more cross-platform.
Ticket #3089. (CVS 5060) FossilOrigin-Name: 07fd9a8c6ca0876f7ec447ce65173957005dc75c
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c10
1 files changed, 9 insertions, 1 deletions
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".
**