Hello !then I did a modification to sqlite3 that basically define a new type "sqlite_double" and use it instead of "double" (#define sqlite_double? double) then I can redefine it to _Decimal64 (#define sqlite_double? _Decimal64) this way with a modern C compiler we can have sqlite3 using decimal arithmetic.
There is some more macros not mentioned here (see at https://github.com/mingodad/squilu/tree/master/SquiLu-ext), I just compiled it with gcc 4.9.3 and executed the examples from this original thread and it works fine. I'll say again that I still think that is a good idea to replace "double" by "sqlite_double" to allow alternative decimal/floating point implementations (on my case _Decimal64). Cheers ! ?