Inconsistent results between numeric and double precision types.
Reproduction:
CREATE TABLE tab(
col1 REAL,
col2 DOUBLE PRECISION,
col3 NUMERIC
);
INSERT into tab VALUES
(10, 10, 10),
(20, 20, 20),
(30, 30, 30),
(40, 40, 40),
(50, 50, 50),
(60, 60, 60),
(70, 70, 70),
(80, 80, 80),
(90, 90, 90),
(100, 100, 100);
SELECT col1, width_bucket(col1, 10, 100, 9), width_bucket(col2, 10, 100, 9), width_bucket(col3, 10, 100, 9) FROM tab;
col1 | width_bucket | width_bucket | width_bucket
------+--------------+--------------+--------------
10 | 1 | 1 | 1
20 | 2 | 2 | 1
30 | 3 | 3 | 2
40 | 4 | 4 | 3
50 | 5 | 5 | 4
60 | 6 | 6 | 6
70 | 7 | 7 | 7
80 | 8 | 8 | 8
90 | 9 | 9 | 9
100 | 10 | 10 | 10
(10 rows)