round(50.5) = 50 - Mailing list pgsql-bugs

From Philipp Matthias Hahn
Subject round(50.5) = 50
Date
Msg-id 403F01FD.7040901@informatik.uni-oldenburg.de
Whole thread Raw
Responses Re: round(50.5) = 50  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-bugs
Hello!

# SELECT round(5.5::float4),round(50.5::float4);
  round | round
-------+-------
      6 |    50
(1 row)

I think this is a bug, since I would expect 6 and 51. Doing the same
without the float4-cast, it works correct. This bug bites me while
passing parameters to a plpgsql function.

This happens both with Debian 7.3.4-9 and 7.4.1-3

Is this a real bug or am I missing something? A bug fix or work-around
would be nice.

BYtE
Philipp
--
       Dipl.-Inform. Philipp.Hahn@informatik.uni-oldenburg.de
       Abteilung Systemsoftware und verteilte Systeme, Fk. II
Carl von Ossietzky Universitaet Oldenburg, 26111 Oldenburg, Germany
     http://www.svs.informatik.uni-oldenburg.de/contact/pmhahn/
       Telefon: +49 441 798-2866    Telefax: +49 441 798-2756

pgsql-bugs by date:

Previous
From: margitsw@t-online.de (Margit Schubert-While)
Date:
Subject: ecpg multidimensional arrays
Next
From: Steve Atkins
Date:
Subject: Integer parsing bug?