Re: Floating point error

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Floating point error
Дата
Msg-id 512ACFFE.2090200@gmail.com
обсуждение исходный текст
Ответ на Floating point error  (Tom Duffey <tduffey@trillitech.com>)
Ответы Re: Floating point error  (Tom Duffey <tduffey@trillitech.com>)
Re: Floating point error  (Edson Richter <edsonrichter@hotmail.com>)
Список pgsql-general
On 02/24/2013 06:13 PM, Tom Duffey wrote:
> Hi Everyone,
>
> Riddle me this. I have a database column of type "real" that gets mapped to a Java field of type double via JDBC. We
havetwo databases, test and production, and the test database is periodically blown away and reloaded from a copy of
production.We recently noticed that some values do not match when viewed within our application on test vs. production.
Morespecifically: 
>
> - Selecting values from both test and production DBs using psql shows "10.3885" as the value
> - The Java app on production shows "10.3884573" while the test app shows "10.3885"
>
> I have a hunch that when the value was originally inserted into the production DB it probably contained more than the
6digits supported by the real data type. It may have even been exactly the "10.3884573" value we see when retrieving
viaJDBC on production. What I don't understand is why when the value gets mapped back to Java via JDBC those extra
digitsare coming back. Can anyone explain this or do you think I'm on the wrong track? I stepped through code and it
sureseems like the extra information is coming back from the JDBC driver. 

Are the production and test apps running on the same platform i.e. OS,
bitness, etc.

>
> Tom
>
> --
> Tom Duffey
> tduffey@trillitech.com
> 414-751-0600 x102
>
>
>


--
Adrian Klaver
adrian.klaver@gmail.com

В списке pgsql-general по дате отправления:

Предыдущее
От: Edson Richter
Дата:
Сообщение: Re: Floating point error
Следующее
От: Tom Duffey
Дата:
Сообщение: Re: Floating point error