diff options
author | drh <> | 2021-09-06 11:44:19 +0000 |
---|---|---|
committer | drh <> | 2021-09-06 11:44:19 +0000 |
commit | e534c7b97fcb8a6283b9c42da56b2dd1a99e12de (patch) | |
tree | 686f0541a875b70137a261fc7ef25979c5ffd260 /src | |
parent | e7e9539d99b2cdc63d354bc31933f3be7b4bbc4c (diff) | |
download | sqlite-e534c7b97fcb8a6283b9c42da56b2dd1a99e12de.tar.gz sqlite-e534c7b97fcb8a6283b9c42da56b2dd1a99e12de.zip |
Restore the use of system isnan() that was removed by
check-in [ea748edecb261f2b]. See
[forum:/forumpost/d7c530ac587f59e6|forum thread d7c530ac587f59e6].
FossilOrigin-Name: b3cfe23bec0b95ca673802526704200e2396df715fdded72aa71addd7f47e0e1
Diffstat (limited to 'src')
-rw-r--r-- | src/util.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c index 2d1c64ad1..44c0195ca 100644 --- a/src/util.c +++ b/src/util.c @@ -60,11 +60,21 @@ int sqlite3FaultSim(int iTest){ #ifndef SQLITE_OMIT_FLOATING_POINT /* ** 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 rc; /* The value return */ +#if !SQLITE_HAVE_ISNAN && !HAVE_ISNAN u64 y; memcpy(&y,&x,sizeof(y)); - return IsNaN(y); + rc = IsNaN(y); +#else + rc = isnan(x); +#endif /* HAVE_ISNAN */ + testcase( rc ); + return rc; } #endif /* SQLITE_OMIT_FLOATING_POINT */ |