Re: BUG #8317: ROUND(double*1/2) != ROUND(1/2*double)

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: BUG #8317: ROUND(double*1/2) != ROUND(1/2*double)
Дата
Msg-id CAFj8pRB9FTO24A0rJ1jrd_NUaBKUhxoxbW-2-bdQwuFQxemG4w@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #8317: ROUND(double*1/2) != ROUND(1/2*double)  (remi.cura@gmail.com)
Ответы Re: BUG #8317: ROUND(double*1/2) != ROUND(1/2*double)  (Rémi Cura <remi.cura@gmail.com>)
Список pgsql-bugs
2013/7/22  <remi.cura@gmail.com>:
> The following bug has been logged on the website:
>
> Bug reference:      8317
> Logged by:          R=C3=A9mi
> Email address:      remi.cura@gmail.com
> PostgreSQL version: 9.2.4
> Operating system:   Ubuntu 12.0.4 32 bits hosted by a VirtualBox
> Description:
>
> Hello;
> I ran into a strange behaviour.
> Initially it showed in a group by, but is also happens in regular select =
:
>
>
> example :
> SELECT 2*ROUND(1/2*3.2)
> --> gives 0
> SELECT 2*ROUND(3.2*1/2)
> --> gives 3
>
>

Hello

It is not a bug - a reason for this behave is using a integer div in first =
case

( 1 / 2 ) * 3.2 ... 1/2 .. integer div, because left operand is int
and right operand is int
(3.2 * 1) / 2 ... 3.2 / 2 .. using numeric div, left operand is
numeric and right operand is int

Regards

Pavel Stehule



> Obviously both should return the same thing, preferably 3.
> It looks like a bug to me, or at least a non desirable behaviour.
>
>
> Cheers,
> R=C3=A9mi
>
>
>
> --
> Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: BUG #8317: ROUND(double*1/2) != ROUND(1/2*double)
Следующее
От: Feike Steenbergen
Дата:
Сообщение: Re: 9.3beta2 unrecognized node type in join alias vars when retrieving view definition