Skip site navigation (1) Skip section navigation (2)

General Bug Report: Incorrect subtraction - rounding error - should NOT round!

From: Unprivileged user <nobody>
To: pgsql-bugs(at)postgresql(dot)org
Subject: General Bug Report: Incorrect subtraction - rounding error - should NOT round!
Date: 1999-01-12 02:37:11
Message-ID: 199901120237.VAA01180@hub.org (view raw or flat)
Thread:
Lists: pgsql-bugs
============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name		: Jeffrey Springer
Your email address	: jspringr(at)savemail(dot)com

Category		: runtime: back-end: SQL
Severity		: critical

Summary: Incorrect subtraction - rounding error - should NOT round!

System Configuration
--------------------
  Operating System   : FreeBSD 2.2.7

  PostgreSQL version : 6.3.2

  Compiler used      : gcc 2.7

Hardware:
---------
AMD K6 with 32M Ram

Versions of other tools:
------------------------
gmake

--------------------------------------------------------------------------

Problem Description:
--------------------
I put together a banking web-site using Postgres. I put a
check and deducted the amount from the balance column of
the bank_account table. The result was incorrect so I tested
it inside psql instead of my C++ program but got the
same result.

--------------------------------------------------------------------------

Test Case:
----------
template1=> select 166952.9 - 166384.34 ;
	?column?
----------------
568.559999999998
(1 row)

--------------------------------------------------------------------------

Solution:
---------


--------------------------------------------------------------------------


pgsql-bugs by date

Next:From: Roland RobertsDate: 1999-01-14 01:52:36
Subject: Postgres 6.3.2 varchar <--> int4 conversions
Previous:From: Unprivileged userDate: 1999-01-11 20:40:07
Subject: General Bug Report: tutorial samples not updated

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group