Re: BUG #8317: ROUND(double*1/2) != ROUND(1/2*double) - Mailing list pgsql-bugs

From Kevin Grittner
Subject Re: BUG #8317: ROUND(double*1/2) != ROUND(1/2*double)
Date
Msg-id 1375219056.72045.YahooMailNeo@web162903.mail.bf1.yahoo.com
Whole thread Raw
In response to Re: BUG #8317: ROUND(double*1/2) != ROUND(1/2*double)  (Rémi Cura <remi.cura@gmail.com>)
List pgsql-bugs
R=E9mi Cura <remi.cura@gmail.com> wrote:=0A=0A> According to the doc=0A> ( =
http://www.postgresql.org/docs/9.2/static/sql-syntax-lexical.html#SQL-SYNTA=
X-OPERATORS ),=0A> multiplication has precedence on division. (I supposed i=
t implicitely)=0A=0AThe correct link is:=0A=0Ahttp://www.postgresql.org/doc=
s/9.2/static/sql-syntax-lexical.html#SQL-PRECEDENCE-TABLE=0A=0AAnd it shows=
 multiplication, division, and modulo as having equal=0Aprecedence, with le=
ft-to-right associativity.=0A=0A> So anyway the query is parsed as ( 1/ (2*=
3.2)) and ( 3.2*1) / 2 ),=0A=0ANo, it is ((1 / 2) * 3.2) and ((3.2 * 1) / 2=
).=0A=0AThose evaluate to (0 * 3.2) and (3.2 / 2), respectively.=0A=0A--=0A=
Kevin Grittner=0AEDB: http://www.enterprisedb.com=0AThe Enterprise PostgreS=
QL Company

pgsql-bugs by date:

Previous
From: Warwick Chapman
Date:
Subject: Re: PostgreSQL and OpenVZ
Next
From: Michael Paquier
Date:
Subject: Re: BUG #8345: PostGre SQL database is crashing