Re: [GENERAL] Significant Digits in Floating Point Datatype

2011-11-20 Thread Lee Hachadoorian
On 11/20/2011 02:06 PM, Tom Lane wrote: Lee Hachadoorian 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 m

Re: [GENERAL] Significant Digits in Floating Point Datatype

2011-11-20 Thread Bill Moran
On 11/20/11 1:29:37 PM, Lee Hachadoorian wrote: I would like to store some in a single array some data that is conceptually related, but some of the data is floating point, and some of it is integer. Obviously the integer data *can* be stored as double precision, but I need to know about potentia

Re: [GENERAL] Significant Digits in Floating Point Datatype

2011-11-20 Thread Tom Lane
Lee Hachadoorian 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 othe

[GENERAL] Significant Digits in Floating Point Datatype

2011-11-20 Thread Lee Hachadoorian
I would like to store some in a single array some data that is conceptually related, but some of the data is floating point, and some of it is integer. Obviously the integer data *can* be stored as double precision, but I need to know about potential loss of precision. Double precision has "a p