nalgeon / sqlean

The ultimate set of SQLite extensions
MIT License
3.76k stars 120 forks source link

incorrect results in percentile functions #107

Closed axxName closed 10 months ago

axxName commented 10 months ago

CREATE TABLE test (num INT);

insert into test values(1); insert into test values(2); insert into test values(3); insert into test values(4); insert into test values(9);

select percentile_75(num) from test; sqlite> select percentile_75(num) from test; 4.0

But values in table are INTegers, not float!

nalgeon commented 10 months ago

The return type of the precentile function is real, regardless of its argument type.