Skip site navigation (1) Skip section navigation (2)

Re: Possible rounding error of large float values?

From: "Iain" <iain(at)mst(dot)co(dot)jp>
To: "Stephan Szabo" <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: "Adam Lancaster" <alancaster(at)preventsys(dot)com>,<pgsql-sql(at)postgresql(dot)org>
Subject: Re: Possible rounding error of large float values?
Date: 2004-08-25 02:48:11
Message-ID: 008101c48a4d$f5cd64d0$7201a8c0@mst1x5r347kymb (view raw or flat)
Thread:
Lists: pgsql-sql
> 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


In response to

pgsql-sql by date

Next:From: Pedro B.Date: 2004-08-25 14:21:40
Subject: PQexec and SPI_exec
Previous:From: Stephan SzaboDate: 2004-08-25 01:41:37
Subject: Re: Possible rounding error of large float values?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group