Re: Unexpected result using floor() function - Mailing list pgsql-general

From Pujol Mathieu
Subject Re: Unexpected result using floor() function
Date
Msg-id 56E6C8D8.1040604@realfusio.com
Whole thread Raw
In response to Unexpected result using floor() function  ("Frank Millman" <frank@chagford.com>)
Responses Re: Unexpected result using floor() function  (Merlin Moncure <mmoncure@gmail.com>)
Re: Unexpected result using floor() function  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
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

Mathieu

Le 14/03/2016 15:11, Frank Millman a écrit :
Hi all
 
I am running PostgreSQL 9.4.4 on Fedora 22.
 
SELECT floor(4.725 * 100 + 0.5) returns 473, which is what I expected.
 
SELECT floor(4.725 * power(10, 2) + 0.5) returns 472, which I find surprising.
 
Please can someone explain the anomaly.
 
Thanks
 
Frank Millman
 

-- 
Mathieu PUJOL
Ingénieur Réalité Virtuelle
Tel : 05.81.33.13.36
REAL FUSIO - 3D Computer Graphics
9, rue Paul Mesple - 31100 TOULOUSE - FRANCE
mathieu.pujol@realfusio.com - http://www.realfusio.com

pgsql-general by date:

Previous
From: "Frank Millman"
Date:
Subject: Unexpected result using floor() function
Next
From: Vick Khera
Date:
Subject: Re: Unexpected result using floor() function