Re: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue

Поиск
Список
Период
Сортировка
От Andreas Joseph Krogh
Тема Re: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue
Дата
Msg-id VisenaEmail.91.1593ba84a90d02a5.17547533c82@tc7-visena
обсуждение исходный текст
Ответ на Re: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue  (Mikael <mikael.aronsson@gmail.com>)
Список pgsql-jdbc
På tirsdag 20. oktober 2020 kl. 19:17:54, skrev Tom Lane <tgl@sss.pgh.pa.us>:
Andreas Joseph Krogh <andreas@visena.com> writes:
>  How can this be sane?

If you're expecting exact results from float calculations, you need
a refresher course in what floating-point arithmetic is all about.
 
From a programming perspective - yes, from a DB-client perspective, and in general, no way. In general - "Users" expect "reals" to be just "decimal-numbers", so with this behaviour of float in PG so close to "C-float" there should, IMO, be a big fat warning "Don't use the float datatype, at all" somewhere. Try to tell an accountant that doing calculations with floating-point numbers is crazy, and you should expect the computer to give you wrong answers...
 
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
 
Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue