pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Iain <iain@mst.co.jp>
To: Stephan Szabo <sszabo@megazone.bigpanda.com>
Cc: Adam Lancaster <alancaster@preventsys.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Possible rounding error of large float values?
Date: Wed, 25 Aug 2004 11:48:11 +0900
Message-ID: <008101c48a4d$f5cd64d0$7201a8c0@mst1x5r347kymb> (raw)
References: <8758F8D58219684FAB0239EE8967048A010807@calculon.preventsys.com>
	<200408241252.30182.josh@agliodbs.com>
	<1093378875.15248.39.camel@linda>
	<005b01c48a43$630db0a0$7201a8c0@mst1x5r347kymb>
	<20040824183612.M67501@megazone.bigpanda.com>

> I don't think that's true since the number ending in 807 is equal to a
> version ending in 808.
>
> sszabo=# select 9223372036854775807 = 9223372036854775808::float;
>  ?column?
> ----------
>  t
> (1 row)

Good point. I think that the problems with using floats are well documented
(I particulary like the doc that come with IBMs java.lang.BigDecimal
package) so there shouldn't be any excuse for being surprised by how they
behave. Basically floats are fine when used for what they were desgned for,
but a liability otherwise.

Just thinking about it now, I can't remember last time I designed a database
that used float data...

regards
Iain




view thread (7+ messages)

Message-ID: <008101c48a4d$f5cd64d0$7201a8c0@mst1x5r347kymb>
Permalink:  ../008101c48a4d$f5cd64d0$7201a8c0@mst1x5r347kymb/
Also on:    postgresql.org/message-id/008101c48a4d$f5cd64d0$7201a8c0@mst1x5r347kymb

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: iain@mst.co.jp, sszabo@megazone.bigpanda.com, alancaster@preventsys.com
  Subject: Re: Possible rounding error of large float values?
  In-Reply-To: <008101c48a4d$f5cd64d0$7201a8c0@mst1x5r347kymb>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox