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

Bug #644: Incorrect result in math operation

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #644: Incorrect result in math operation
Date: 2002-04-24 08:33:00
Message-ID: 20020424083300.1091B475862@postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
Francisco Blay (franblay(at)ono(dot)com) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
Incorrect result in math operation

Long Description
3088.8 - (2847.64 + 241.16)=4.54747350886464e-13
It's spected to be 0.0 the result of this operation (I think)
Got the same results in

PIII:

franblay=> select version();
                            version
---------------------------------------------------------------
 PostgreSQL 7.0.3 on i686-pc-linux-gnu, compiled by gcc 2.95.2
(1 row)

AMD Athlon:

datadb=# select version();
                           version
-------------------------------------------------------------
 PostgreSQL 7.2 on i686-pc-linux-gnu, compiled by GCC 2.95.2
(1 row)

Both SuSE 7.0
Libraries:
                      libe2p.so.2          libpam.so.0
                      libe2p.so.2.3        libpam.so.0.72
                      libext2fs.so.2       libpam_misc.so.0
                      libext2fs.so.2.4     libpam_misc.so.0.72
ld-2.1.3.so           libhistory.so.4      libpamc.so.0
ld-linux.so.1         libhistory.so.4.1    libpamc.so.0.72
ld-linux.so.1.9.9     libm.so.6            libpthread.so.0
ld-linux.so.2         libncurses.so.4      libreadline.so.4
ld.so                 libncurses.so.4.2    libreadline.so.4.1
ld.so.1.9.9           libncurses.so.5      libresolv.so.2
libBrokenLocale.so.1  libncurses.so.5.0    librt.so.1
libNoVersion.so.1     libnsl.so.1          libss.so.2
libSegFault.so        libnss_compat.so.2   libss.so.2.0
libc.so.6             libnss_db.so.2       libthread_db.so.1
libcom_err.so.2       libnss_dns.so.2      libutil.so.1
libcom_err.so.2.0     libnss_dns6.so.2     libuuid.so.1
libcrypt.so.1         libnss_files.so.2    libuuid.so.1.2
libdb.so.2            libnss_hesiod.so.2   
libdb.so.3            libnss_nis.so.2      
libdl.so.2            libnss_nisplus.so.2


Sample Code
datadb=# select 3088.8 - 3088.8 AS ok;
 ok
----
  0
(1 row)

datadb=# select 3088.8 - (2847.64 + 241.16) AS silly;
        silly
----------------------
 4.54747350886464e-13
(1 row)


No file was uploaded with this report


Responses

pgsql-bugs by date

Next:From: Dmitry TsitelovDate: 2002-04-24 09:17:25
Subject: Re: Bug #644: Incorrect result in math operation
Previous:From: Tom LaneDate: 2002-04-24 04:50:43
Subject: Re: Bug #643: spin lock aborts in 7.0.3

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