/ Check-in [97c6ea23]
Login

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

Overview
Comment:Get the behavior of SQLITE_HAVE_ISNAN right. It was reversed in check-in (6517). Ticket #3809. (CVS 6518)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:97c6ea2368556b2a9a914ba2322085e312598b15
User & Date: drh 2009-04-17 15:18:48
Context
2009-04-17
16:54
Revise the implementation of sqlite3_initialize() slightly in order to make it more easily testable. The functionality should be unchanged. (CVS 6519) check-in: bb1a390a user: drh tags: trunk
15:18
Get the behavior of SQLITE_HAVE_ISNAN right. It was reversed in check-in (6517). Ticket #3809. (CVS 6518) check-in: 97c6ea23 user: drh tags: trunk
11:57
Add the SQLITE_HAVE_ISNAN compile-time option which, if present, causes SQLite to use the math library isnan() function rather than its own homebrew implementation of isnan(). (CVS 6517) check-in: 54d23521 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to src/util.c.

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
**
*************************************************************************
** Utility functions used throughout sqlite.
**
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
** $Id: util.c,v 1.250 2009/04/17 11:57:22 drh Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
#include <math.h>

/*
** Routine needed to support the testcase() macro.
................................................................................
/*
** Return true if the floating point value is Not a Number (NaN).
**
** Use the math library isnan() function if compiled with SQLITE_HAVE_ISNAN.
** Otherwise, we have our own implementation that works on most systems.
*/
int sqlite3IsNaN(double x){
#if defined(SQLITE_HAVE_ISNAN)
  /*
  ** Systems that support the isnan() library function should probably
  ** make use of it by compiling with -DSQLITE_HAVE_ISNAN.  But we have
  ** found that many systems do not have a working isnan() function so
  ** this implementation is provided as an alternative.
  **
  ** This NaN test sometimes fails if compiled on GCC with -ffast-math.







|







 







|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
**
*************************************************************************
** Utility functions used throughout sqlite.
**
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
** $Id: util.c,v 1.251 2009/04/17 15:18:48 drh Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
#include <math.h>

/*
** Routine needed to support the testcase() macro.
................................................................................
/*
** Return true if the floating point value is Not a Number (NaN).
**
** Use the math library isnan() function if compiled with SQLITE_HAVE_ISNAN.
** Otherwise, we have our own implementation that works on most systems.
*/
int sqlite3IsNaN(double x){
#if !defined(SQLITE_HAVE_ISNAN)
  /*
  ** Systems that support the isnan() library function should probably
  ** make use of it by compiling with -DSQLITE_HAVE_ISNAN.  But we have
  ** found that many systems do not have a working isnan() function so
  ** this implementation is provided as an alternative.
  **
  ** This NaN test sometimes fails if compiled on GCC with -ffast-math.