Re: Unexpected result using floor() function

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Pujol Mathieu <mathieu(dot)pujol(at)realfusio(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Unexpected result using floor() function
Date: 2016-03-14 14:29:07
Message-ID: CAHyXU0z_zEpZrPUt9ec1b-YLtQX9HQqoGc3aYVw-9fbFd1fteg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Mar 14, 2016 at 9:21 AM, Pujol Mathieu
<mathieu(dot)pujol(at)realfusio(dot)com> wrote:
> Hi
> I reproduce your bug using "PostgreSQL 9.3.6, compiled by Visual C++ build
> 1600, 64-bit" on Windows 8
> I also notice that SELECT floor(4.725 * power(10, 2)::numeric + 0.5) work as
> expected

I don't think this is a bug -- just peculiarities of floating point math.

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2016-03-14 14:29:28 Re: Unexpected result using floor() function
Previous Message Vick Khera 2016-03-14 14:28:03 Re: Unexpected result using floor() function