Search Postgresql Archives

Re: Significant Digits in Floating Point Datatype

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/20/2011 02:06 PM, Tom Lane wrote:
Lee Hachadoorian<lee.hachadoorian@xxxxxxxxx>  writes:
And can I reliably retrieve the original integer by
casting to int (or bigint) if the number of digits in the original
integer is less than 15?
On IEEE-floating-point machines, I'd expect float8 to store integers
up to 2^52 (or maybe it's 2^53) exactly.  With other floating-point
formats the limit might be different, but it should still be exact for
reasonable-size integers.  This has nothing whatever to do with whether
decimal fractions are reproduced exactly (in general, they aren't, no
matter how many or few digits are involved).  So integers are fine,
bigints not so much.

			regards, tom lane

Thank you, that clarification is extremely useful.  --Lee

--
Lee Hachadoorian
PhD, Earth&  Environmental Sciences (Geography)
Research Associate, CUNY Center for Urban Research
http://freecity.commons.gc.cuny.edu


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux