/ Check-in [e20f2b8c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added comment on floating point precision compile option for MSVC. (CVS 5448)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e20f2b8c6a13aa826703441cf340d0ee03bf9f64
User & Date: shane 2008-07-22 05:15:53
Context
2008-07-22
05:18
Changed a few loop counters to unsigned ints to remove compiler warnings. (CVS 5449) (check-in: 16f51f9b user: shane tags: trunk)
05:15
Added comment on floating point precision compile option for MSVC. (CVS 5448) (check-in: e20f2b8c user: shane tags: trunk)
05:13
Add assertion check for NaN support at startup. (CVS 5447) (check-in: 8474cde3 user: shane tags: trunk)
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/util.c.

    10     10   **
    11     11   *************************************************************************
    12     12   ** Utility functions used throughout sqlite.
    13     13   **
    14     14   ** This file contains functions for allocating memory, comparing
    15     15   ** strings, and stuff like that.
    16     16   **
    17         -** $Id: util.c,v 1.238 2008/07/11 16:19:10 drh Exp $
           17  +** $Id: util.c,v 1.239 2008/07/22 05:15:53 shane Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   #include <stdarg.h>
    21     21   #include <ctype.h>
    22     22   
    23     23   
    24     24   /*
    25         -** Return true if the floating point value is Not a Number.
           25  +** Return true if the floating point value is Not a Number (NaN).
    26     26   */
    27     27   int sqlite3IsNaN(double x){
    28     28     /* This NaN test sometimes fails if compiled on GCC with -ffast-math.
    29     29     ** On the other hand, the use of -ffast-math comes with the following
    30     30     ** warning:
    31     31     **
    32     32     **      This option [-ffast-math] should never be turned on by any
    33     33     **      -O option since it can result in incorrect output for programs
    34     34     **      which depend on an exact implementation of IEEE or ISO 
    35     35     **      rules/specifications for math functions.
           36  +  **
           37  +  ** Under MSVC, this NaN test may fail if compiled with a floating-
           38  +  ** point precision mode other than /fp:precise.  From the MSDN 
           39  +  ** documentation:
           40  +  **
           41  +  **      The compiler [with /fp:precise] will properly handle comparisons 
           42  +  **      involving NaN. For example, x != x evaluates to true if x is NaN 
           43  +  **      ...
    36     44     */
    37     45   #ifdef __FAST_MATH__
    38     46   # error SQLite will not work correctly with the -ffast-math option of GCC.
    39     47   #endif
    40     48     volatile double y = x;
    41     49     volatile double z = y;
    42     50     return y!=z;