Index: src/util.c ================================================================== --- src/util.c +++ src/util.c @@ -12,19 +12,19 @@ ** Utility functions used throughout sqlite. ** ** This file contains functions for allocating memory, comparing ** strings, and stuff like that. ** -** $Id: util.c,v 1.238 2008/07/11 16:19:10 drh Exp $ +** $Id: util.c,v 1.239 2008/07/22 05:15:53 shane Exp $ */ #include "sqliteInt.h" #include #include /* -** Return true if the floating point value is Not a Number. +** Return true if the floating point value is Not a Number (NaN). */ int sqlite3IsNaN(double x){ /* This NaN test sometimes fails if compiled on GCC with -ffast-math. ** On the other hand, the use of -ffast-math comes with the following ** warning: @@ -31,10 +31,18 @@ ** ** This option [-ffast-math] should never be turned on by any ** -O option since it can result in incorrect output for programs ** which depend on an exact implementation of IEEE or ISO ** rules/specifications for math functions. + ** + ** Under MSVC, this NaN test may fail if compiled with a floating- + ** point precision mode other than /fp:precise. From the MSDN + ** documentation: + ** + ** The compiler [with /fp:precise] will properly handle comparisons + ** involving NaN. For example, x != x evaluates to true if x is NaN + ** ... */ #ifdef __FAST_MATH__ # error SQLite will not work correctly with the -ffast-math option of GCC. #endif volatile double y = x;