From: | Andreas Joseph Krogh <andreas(at)visena(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "Thangavel, Parameswaran" <Parameswaran(dot)Thangavel(at)rsa(dot)com>, "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Re: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue |
Date: | 2020-10-20 18:51:53 |
Message-ID: | VisenaEmail.91.1593ba84a90d02a5.17547533c82@tc7-visena |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
På tirsdag 20. oktober 2020 kl. 19:17:54, skrev Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us
<mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us>>:
Andreas Joseph Krogh <andreas(at)visena(dot)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
andreas(at)visena(dot)com <mailto:andreas(at)visena(dot)com>
www.visena.com <https://www.visena.com>
<https://www.visena.com>
From | Date | Subject | |
---|---|---|---|
Next Message | David G. Johnston | 2020-10-20 18:59:45 | Re: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue |
Previous Message | Tom Lane | 2020-10-20 17:17:54 | Re: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue |