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

From remi.cura@gmail.com
Subject BUG #8317: ROUND(double*1/2) != ROUND(1/2*double)
Date
Msg-id E1V1Cfq-00076T-El@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #8317: ROUND(double*1/2) != ROUND(1/2*double)
Re: BUG #8317: ROUND(double*1/2) != ROUND(1/2*double)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      8317
Logged by:          Rémi
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


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émi

pgsql-bugs by date:

Previous
From: Andres Freund
Date:
Subject: Re: 9.3beta2 unrecognized node type in join alias vars when retrieving view definition
Next
From: Andres Freund
Date:
Subject: Re: BUG #8317: ROUND(double*1/2) != ROUND(1/2*double)