SQLite Forum

Actually, the one that gets the exact answer is using quadruple precision intermediates (Float128).  

The extended precision "long double" still arrives at an answer that is inexact when rounded to a double, ie: 999950000.000008

I had just made sure that all "long double" in the codebase is using the declaration LONGDOUBLE_TYPE and that if the compiler is GCC then  
`#define LONGDOUBLE_TYPE __float128`  
rather than  
`#define LONGDOUBLE_TYPE long double`  
in config.h

The LONGDOUBLE_TYPE is defined as "long double" in sqliteInt.h if it is not already defined.  Since the config.h is processed before sqliteInt.h, the definition in config.h takes precedence.