dbTalk Databases Forums  

[BUGS] BUG #2211: select (1::float-1::float)*(-1) = -0 ??

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2211: select (1::float-1::float)*(-1) = -0 ?? in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tiago D. J.
 
Posts: n/a

Default [BUGS] BUG #2211: select (1::float-1::float)*(-1) = -0 ?? - 01-26-2006 , 10:04 AM







The following bug has been logged online:

Bug reference: 2211
Logged by: Tiago D. J.
Email address: tiago (AT) mdtestudio (DOT) com.br
PostgreSQL version: 8.1
Operating system: Slackware 10.2
Description: select (1::float-1::float)*(-1) = -0 ??
Details:

Hi people,
I think that anything * 0, or 0*anything should be zero.
But run this query :
select (1::float-1::float)*(-1)

it returns -0

Sorry, my english is so poor,
I hope that i'm helping you with this information.

Tiago

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply With Quote
  #2  
Old   
Jaime Casanova
 
Posts: n/a

Default Re: [BUGS] BUG #2211: select (1::float-1::float)*(-1) = -0 ?? - 01-26-2006 , 10:10 AM






On 1/25/06, Tiago D. J. <tiago (AT) mdtestudio (DOT) com.br> wrote:
Quote:
The following bug has been logged online:

Bug reference: 2211
Logged by: Tiago D. J.
Email address: tiago (AT) mdtestudio (DOT) com.br
PostgreSQL version: 8.1
Operating system: Slackware 10.2
Description: select (1::float-1::float)*(-1) =3D -0 ??
Details:

Hi people,
I think that anything * 0, or 0*anything should be zero.
But run this query :
select (1::float-1::float)*(-1)

it returns -0

Sorry, my english is so poor,
I hope that i'm helping you with this information.

Tiago

pruebas=3D# select version();
version

---------------------------------------------------------------------------=
---------------
PostgreSQL 8.1.1 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC)
3.4.2 (mingw-special)
(1 fila)


pruebas=3D# select (1::float-1::float)*(-1);
?column?
----------
0
(1 fila)


This is good for me... maybe a bug already fixed?

--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


Reply With Quote
  #3  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #2211: select (1::float-1::float)*(-1) = -0 ?? - 01-26-2006 , 10:16 AM



"Tiago D. J." <tiago (AT) mdtestudio (DOT) com.br> writes:
Quote:
But run this query :
select (1::float-1::float)*(-1)

it returns -0
AFAIK this is correct behavior per the IEEE floating-point-math spec.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.