mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-09 14:21:03 +03:00
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) FossilOrigin-Name: 54d23521c37938b9d98f41f5547975c469c0c8f0
This commit is contained in:
12
manifest
12
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Check-in\s(6514)\sdid\snot\scompletely\sremove\sthe\sobsolete\stest,\sresulting\sin\sa\nsegfault.\s\sThis\scheck-in\sfinishes\sthe\sjob.\s\sTicket\s#3802.\s(CVS\s6516)
|
C Add\sthe\sSQLITE_HAVE_ISNAN\scompile-time\soption\swhich,\sif\spresent,\scauses\nSQLite\sto\suse\sthe\smath\slibrary\sisnan()\sfunction\srather\sthan\sits\sown\shomebrew\nimplementation\sof\sisnan().\s(CVS\s6517)
|
||||||
D 2009-04-17T11:56:28
|
D 2009-04-17T11:57:22
|
||||||
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
||||||
F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
|
F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
|
||||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||||
@@ -198,7 +198,7 @@ F src/tokenize.c 7bd3b6dd56566604ad24ed4aa017e6618166b500
|
|||||||
F src/trigger.c 21f39db410cdc32166a94900ac1b3df98ea560e6
|
F src/trigger.c 21f39db410cdc32166a94900ac1b3df98ea560e6
|
||||||
F src/update.c 8ededddcde6f7b6da981dd0429a5d34518a475b7
|
F src/update.c 8ededddcde6f7b6da981dd0429a5d34518a475b7
|
||||||
F src/utf.c 9541d28f40441812c0b40f00334372a0542c00ff
|
F src/utf.c 9541d28f40441812c0b40f00334372a0542c00ff
|
||||||
F src/util.c 469d74f5bf09ed6398702c7da2ef8a34e979a1c1
|
F src/util.c 3990f949a4a0fbdd62552ee34b4d22aec7910305
|
||||||
F src/vacuum.c 07121a727beeee88f27d704a00313ad6a7c9bef0
|
F src/vacuum.c 07121a727beeee88f27d704a00313ad6a7c9bef0
|
||||||
F src/vdbe.c 88bc70921ccdcff8bfdf574f3e2285d17ab97103
|
F src/vdbe.c 88bc70921ccdcff8bfdf574f3e2285d17ab97103
|
||||||
F src/vdbe.h 35a648bc3279a120da24f34d9a25213ec15daf8a
|
F src/vdbe.h 35a648bc3279a120da24f34d9a25213ec15daf8a
|
||||||
@@ -717,7 +717,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
|
|||||||
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
||||||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||||
P fbbc80eaf3bb3726b053d1050104b4ec602eb0c1
|
P c29b37ea36fe6a360807e66dffc467c66be00d38
|
||||||
R c8bde6c6b0390f10634d507d904faa5d
|
R 247ae40bc2309c99608c794edcff5bc4
|
||||||
U drh
|
U drh
|
||||||
Z 8e3db78cb71447734b970da6417db69a
|
Z da2ba0741571881997e395a38a2e00f8
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
c29b37ea36fe6a360807e66dffc467c66be00d38
|
54d23521c37938b9d98f41f5547975c469c0c8f0
|
||||||
18
src/util.c
18
src/util.c
@@ -14,10 +14,11 @@
|
|||||||
** This file contains functions for allocating memory, comparing
|
** This file contains functions for allocating memory, comparing
|
||||||
** strings, and stuff like that.
|
** strings, and stuff like that.
|
||||||
**
|
**
|
||||||
** $Id: util.c,v 1.249 2009/03/01 22:29:20 drh Exp $
|
** $Id: util.c,v 1.250 2009/04/17 11:57:22 drh Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Routine needed to support the testcase() macro.
|
** Routine needed to support the testcase() macro.
|
||||||
@@ -52,9 +53,19 @@ int sqlite3Assert(void){
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
** Return true if the floating point value is Not a Number (NaN).
|
** 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){
|
int sqlite3IsNaN(double x){
|
||||||
/* This NaN test sometimes fails if compiled on GCC with -ffast-math.
|
#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.
|
||||||
** On the other hand, the use of -ffast-math comes with the following
|
** On the other hand, the use of -ffast-math comes with the following
|
||||||
** warning:
|
** warning:
|
||||||
**
|
**
|
||||||
@@ -77,6 +88,9 @@ int sqlite3IsNaN(double x){
|
|||||||
volatile double y = x;
|
volatile double y = x;
|
||||||
volatile double z = y;
|
volatile double z = y;
|
||||||
return y!=z;
|
return y!=z;
|
||||||
|
#else /* if defined(SQLITE_HAVE_ISNAN) */
|
||||||
|
return isnan(x);
|
||||||
|
#endif /* SQLITE_HAVE_ISNAN */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user