SQLite Forum

SQLite3 Extension
Login
Actually they are quite complex to calculate properly, though there are known methods of computing such things by successive approximation which are generally free of pathological behaviour, such methods are not implemented as built-ins for SQLite -- even the builtin AVG() function is implemented in its most pathologically susceptible form.

And you should not use the method from that web page, except when calculating by pencil and paper, as it also suffers from pathological defects when implemented on a computer.