nalgeon / sqlean

The ultimate set of SQLite extensions
MIT License
3.65k stars 115 forks source link

incorrect results in percentile functions #107

Closed axxName closed 8 months ago

axxName commented 8 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 8 months ago

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