Re: BUG #1179: Time comparison fail - Mailing list pgsql-bugs

From Stephan Szabo
Subject Re: BUG #1179: Time comparison fail
Date
Msg-id 20040622145847.R27122@megazone.bigpanda.com
Whole thread Raw
In response to BUG #1179: Time comparison fail  ("PostgreSQL Bugs List" <pgsql-bugs@postgresql.org>)
List pgsql-bugs
On Tue, 22 Jun 2004, Mauricio CASTRO wrote:

> You are right!
>
> I am doing something wrong? I understand that there is a difference but I
> don't know why.

Floating point math is inexact.  The date_part(...) is returning a value
that is very close to, but not exactly 4.031 due to accuracy limitations.
So, when you multiply it by 1000 you can get a value very close to, but
not exactly 4031. When it tries to compare it to the bigint 4031, it
converts the bigint to a double as well and gets a different double from
the first.

pgsql-bugs by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: BUG #1179: Time comparison fail
Next
From: Kris Jurka
Date:
Subject: Re: BUG #1177: JDBC driver doesn't handle all dates correctly