SQLite Forum

Issues with sqlite3IsNaN() and HAVE_ISNAN

I'm running SQLite under the somewhat esoteric [RISC OS](https://www.riscosopen.org) and I'm having an issue where `sqlite3IsNaN()` sometimes returns the wrong result. I believe that the issue is that `double` and `u64` (`unsigned long long int`) have different word orders on this platform, and therefore the call to `memcpy()` gives us a `u64` with the words the wrong way around.

The easiest solution is to use the `isnan()` function provided by the system. I've changed `sqlite3IsNaN()` accordingly and have confirmed that it works, but I'd prefer not to make changes to core files if it all possible.

According to [Compile-time Options](https://www.sqlite.org/compile.html), `HAVE_ISNAN` will make SQLite use the system `isnan()` function. However, this doesn't work. From what I can tell by looking at the 3.36.0 amalgamation, `HAVE_ISNAN` doesn't do anything, and `isnan()` doesn't seem to be referenced anywhere.

Have I missed something? Is there a way that I can get SQLite to use the system `isnan()` function without modifying the amalgamation?

Aside from that, everything seems to be working correctly. Thank you for SQLite! :)