Search Postgresql Archives

Re: width_bucket issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Jul 24, 2018, at 13:02, Raphaël Berbain <raphael.berbain@xxxxxxxxx> wrote:
> I'd expect b1 = b2 = 2. What am I missing?

The problem appears to be due to rounding during the intermediate calculations.  In compute_bucket() in numeric.c:

		div_var(&operand_var, &bound1_var, result_var,
				select_div_scale(&operand_var, &bound1_var), true);

... produces 0.99999999999999999999 for that particular value, instead of 1, and the subsequent +1 and FLOOR() result in 1 instead of 2.
--
-- Christophe Pettus
   xof@xxxxxxxxxxxx






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux